Hi,
I am using the identification of a variable in VBA for some calculations.
I want to do something similar but using straton, but i canīt see how to acces the variable Tagname/Identification.
Is there a way to do this?
Thank you very much
Hi,
I am using the identification of a variable in VBA for some calculations.
I want to do something similar but using straton, but i canīt see how to acces the variable Tagname/Identification.
Is there a way to do this?
Thank you very much
Hello,
In straton there is a way to access to a variable value from its name.
This is in the 'XML' section because related to it, but you can use it without having an XML file on the runtime.
You have to use the "XMLGETSYBVALUE" function.
The first input is the variable name as a STRING, the second one is TRUE is you want the function to be case sensitive and FALSE if not.
The output is the variable's value as a STRING.
For example for a Global variable:
GlobalVarValue := XMLGETSYBVALUE ( 'MyGlobalVar', FALSE );
For a local one in the program called MainProgram:
LocalVarValue := XMLGETSYBVALUE ( 'MainProgram.MyLocalVar', FALSE );
For a variable in a table at index 'i':
MyVariableAtIndex_i := XMLGETSYBVALUE ( 'MyVar[' + ANY_TO_STRING(i) + ']' , FALSE );
Etc.
IMPORTANT: The 'Syb' checkbox of the variable you want to read must be checked (properties must be Embedded on the target)