12-07-2010 04:35 AM
Hi guys, how to get a local variable in a message Popup? I try "string text"+ Runstate.Caller.Locals.foo ... Coz runstate is while program is running, Caller is the calling step and then local variable.
But this give an error. Where to access my local variables while running?
12-07-2010 05:00 AM
First of all, it depends on the data type of the variable. String can be added "similar" to the way you described. Numeric and boolean has to be cast.
Second, you seem to misunderstand the concept of the RunState-property. If you want to insert a local variable of the sequence you are currently running, the expression should be:
"My Dialog Text " + Locals.<localname>
Don't forget type casts if not working with string variables!
hope this helps,
Norbert
12-07-2010 05:02 AM
Norbert, how I do this typecast?
12-07-2010 05:40 AM
Use the function Str()
eg
"The value is " + Str(Locals.Reading, "%d") where Locals.Reading is a Numeric
12-07-2010 09:31 AM
Just to clarify, RunState.Caller is the caller of the -sequence- you're in, not the caller of the Message Popup. The help file has pretty good explanations for the majority of the RunState sub-properties.