07-20-2010 12:48 PM - edited 07-20-2010 12:49 PM
I have a fileglobal 2 dimensional array of strings. How does one clear it each time the sequence is called, use a for loop? It used to not be a problem but now it seems to have old data in it all the time.
thanx,
jvh
Solved! Go to Solution.
07-20-2010 01:04 PM
I don't know if there's a native TS method to empty/reset a 2D array, but much of our code (going back to TS 1.0!) simply uses the "TestStand - Set Property Value (2D String Array).vi" and a sequence context ref to reset a FileGlobals.
It has worked for us for 10+years...
07-20-2010 03:53 PM
You can do this from an expression:
GetArrayBounds(Locals.Array, Locals.OriginalLowerBounds, Locals.OriginalUpperBounds),
SetArrayBounds(Locals.Array, "[0]", "[]"), // Make the array empty in order to clear it.
SetArrayBounds(Locals.Array, Locals.OriginalLowerBounds, Locals.OriginalUpperBounds) // Restore array back to its original size
Hope this helps,
-Doug
07-21-2010 11:45 AM
Thanks.
Wished there was a one liner..