Forum Discussion

sudhir_optima's avatar
sudhir_optima
Contributor
14 years ago

How to get run time text value

I want to get run time text value, put it in a variable. Later want to use this variable.

I have create  two function as



Below function get the run time text value from text field. Is it correct ?  


function GetDatasetName()

{

var name= Aliases.QBIS.DataSetFactConfigWizard.wizDataSetFactConfigure.completionWizardPage1.txtRenameDataset.get_EditValue()

return(name)





Now created below function which store balve text value into a variable



function SetVarDatasetName()

{

 ProjectSuite.Variables.var_DatasetName=GetDatasetName()

}  



but it seems it is wrong.Because I am trying to perform some action on the object which has the name store in function GetDatasetName()

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I don't see any particular problem with what you're doing.  The only thing I would suggest is that, in your GetDatabaseName function, instead of calling the "get_EditValue()" method, simply use the "value" property.



    You could combine these functions into a single function.  That MIGHT be more" efficient".  but by themselves, everything looks good.



    Is there an error or some problem you're getting?
  • Hi Robert, it seems the value does not get stored in declared variable.



    I have stored it in  var_DatasetName  variable.



     i am calling below function



    Function DatasetConfigure(ProjectSuite.Variable.var_DatasetName)  but it does not performing the action.

    Instead if i gave actual value of the Object name, instead of variable, it performing the action.



    So what it the issues.



    .Value() option is not there. I have tried it with .Get_Text() still it is not working ?



    Is there any problem with Variable Data Type. I am capturing run time text value displayed  from the text box. The value displayed is 'Dataset4'



    I declared the type as String. Is it correct ? Or any other type ?
  • Oh God got it !.While passing the variable value I am directly putting it , instead of variable.That why prevoously it showing "ProjectSuite.variables.var_DatasetName"



    But then i correct my mistake. Removing Double quote of the value solved my problem :)