09-24-2014 04:11 PM - edited 09-24-2014 04:16 PM
I am trying to assign a string result from a step to two seperate variables, namely Step.Result.ReportText, and a local or file global. I can do this with a post expression, but it would be convenient just to do it with an expression tied to the output of a vi. I haven't been able to find any expression syntax that works. Does anybody know if this is even possible?
I need the expression to do the following:
Assign the output of a vi to Step.Result.ReportText
And
Assign the output of the same vi to FileGlobal.XXX
Any hints?
09-25-2014 02:36 PM
This isn't possible. I don't know of any language that allows you to assign one parameter to 2 variables. Interesting concept though.
I would just use the local variable and then in the post expression assign that to the report text as you mentioned. Why are you against that? Just curious.
Regards,
09-25-2014 02:49 PM - edited 09-25-2014 02:51 PM
You can do something like locals.a = locals.b = "blah" in an expression. That will assign the value to both variables. But coming straight from a code module, things don't work that way. Equations just don't work on module outputs. I'm with just leaving it in the post expression.
09-26-2014 07:45 AM
Jigg,
I want to use the content of the Step.Result.ReportText in a post step callback, but as soon as I step into the callback the step properties for the calling step go out of scope and are not accessible. The file global gets around that, so if I could have assigned the desired text to both spots in one fell scoop it would have saved me a little time. Looks like a post expression is the way to go.
09-26-2014 07:57 AM
@rimfire44 wrote:
Jigg,
I want to use the content of the Step.Result.ReportText in a post step callback, but as soon as I step into the callback the step properties for the calling step go out of scope and are not accessible. The file global gets around that, so if I could have assigned the desired text to both spots in one fell scoop it would have saved me a little time. Looks like a post expression is the way to go.
You could try PreviousStep.Result.ReportText
09-28-2014 04:13 PM
PreviousStep won't work like that in a substep. Pass in the sequencecontext to the substep. Then you should be abel to access report text of the step.
Hope this helps,