NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Order of evaluation guaranteed?

I have a sub sequence with the following expression in the cleanup section:

 

RunState.SequenceFailed ? (Locals.SeqStatus = "Failed") : (Locals.SeqStatus = "Passed"), FileGlobals.RptTestData[0][Parameters.SumRptStep] = "Lower Band Edge ("+Str( Parameters.LowFreqMHz)+"/"+Str( Parameters.HighFreqMHz)+"MHz)", FileGlobals.RptTestData[1][Parameters.SumRptStep] = Locals.SeqStatus

 

Locals.SeqStatus appears to exist only as a temporary variable for this sequence of assignments. It is set in the first and used in the  last. With some languages the order execution of comma separated statements is not guaranteed. So I am wondering if this is safe programming or should it be 2 separate TS expressions, i.e. another sequence step

 

thanx,

jvh

0 Kudos
Message 1 of 2
(2,899 Views)

TestStand follows the same rules as C/C++. My nearest C manual (and the TS source) says the comma operator evaluates the first argument THEN the second, so that should be fine.

0 Kudos
Message 2 of 2
(2,892 Views)