01-22-2007 09:24 AM
01-22-2007 03:58 PM
Hi Sean,
If you prefix RunState.Caller then you will able to access the properties of the caller. For every level down prefix additional RunState.Caller.
eg
Say you wanted to access the StationID which is contained in a local in the 'Single Pass' sequence from the Client MainSequence, You would use "RunState.Caller.RunState.Locals.StationInfo.StationID"
Hope this helps to answer your question
Regards
Ray Farmer
01-23-2007 04:13 AM
01-23-2007 05:38 AM
Thanks, Ray. I finally worked out the wisdom of your words!
RunState.Caller does get me the SequenceContext for the current step. I think I'm sorted now. Ta very much.
01-23-2007 05:46 AM
Hi Sean,
To get the value of Locals.MyString from within the ProcessModelPostStep
use as the Lookup string "RunState.Caller.RunState.Locals.MyString"
RunState.Caller gets you back to the Caller Sequence
Hope this helps, if not I'll do an example, but it will be later during the day.
Regards
Ray Farmer
01-23-2007 08:10 AM
I think I'm on the same lines.
I'm using "RunState.Caller" as my SequenceContext, then using "Locals.MyString" as the lookup string. I think this is the same thing, from a slightly different angle.
01-24-2007 03:23 AM
Great stuff. RunState.Caller hops from the model to the sequence being executed. Thanks again Ray.
I just found one weirdo:
e.g. The sequence contains Locals.MyArray (array of strings) and Locals.Index.
I need to obtain the value of Locals.MyArray[Locals.Index], from ProcessModelPostStep. If I use the GetValxxx method, I get an error, as it doesn't correctly evaluate the "Locals.Index" value. It will work with a number as the index, but not with a variable. Instead, I had to do this:
Use "RunState.Caller" as the reference to call the SequenceContext>AsPropertyObject method.
Use the above property object as the reference to call the PropertyObject>EvaluateEx method, with "Locals.MyArray[Locals.Index]" as the exprString.
Use the new property object as the reference to call the PropertyObject>GetValString method, with "" as the exprString.
Weird, but it works!