get the value of a Variable by its name (e.g variableNames)
Posted: Tue Mar 13, 2012 11:30 am
Hei
is it possible to get the value if I just know its name e.g. as I get it from the variableNames() function?
And how I get the running handlers own name? (because the `me`gives me the objects name where the handler is in.
Or is there an other possibility like to get/ log the "Variable" shown under the script window?
I want log some variables at some points. And for this I write a small command that write the wished info to a logfile
The breakpoints interrupt to much and the Message Watcher shows the sequence of the messages ...
and both only works in LC dev environment...
I tried it with this code but the value is allways the name of the Variable
with properties it works fine with some code like this
some suggestion?
thanks
is it possible to get the value if I just know its name e.g. as I get it from the variableNames() function?
And how I get the running handlers own name? (because the `me`gives me the objects name where the handler is in.
Or is there an other possibility like to get/ log the "Variable" shown under the script window?
I want log some variables at some points. And for this I write a small command that write the wished info to a logfile
The breakpoints interrupt to much and the Message Watcher shows the sequence of the messages ...
and both only works in LC dev environment...
I tried it with this code but the value is allways the name of the Variable
Code: Select all
command ShowVariablesNameAndContent
put "Test 11" into TheTestVariable1
put "Test 22" into TheTestVariable2
put "Test 33" into TheTestVariable3
put the variableNames into theVariableNames
-- replace comma with return in theVariableNames
repeat with x= 1 to the number of items in theVariableNames
put item x of theVariableNames into thisVariable
put item x of theVariableNames & ":" && thisVariable into line x of theVariableWithContent
-- put item x of theVariableNames & ":" && value(thisVariable) into line x of theVariableWithContent
-- put item x of theVariableNames & ":" && value("thisVariable") into line x of theVariableWithContent
end repeat
put theVariableWithContent
end ShowVariablesNameAndContent
Code: Select all
put "SomePropName" into cAcustomPropertyName
put the cAcustomPropertyName of this stack into thePropValue
thanks