NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is this giving me an error in Test Stand 3.5?

Why is this giving me an error in Test Stand 3.5?  All parameters exist.
 
RunState.NextStep.Limits.String = Mid( Parameters.WriteData, Find( Parameters.WriteData,   " ", 0, false, false ))
0 Kudos
Message 1 of 6
(3,622 Views)
Hi,
 
If there in no match with your find() it returns -1, and you cannot have -1 as the start index for the Mid()
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 6
(3,613 Views)
Thanks.  So I can pass a variable that could have -1, but not use a functrion that could return -1. 
0 Kudos
Message 3 of 6
(3,611 Views)
Hi,
 
whether you have a variable whose value is -1 or use the return value of a function which is -1, if you use it for the Start Index of the Mid() function an error will be generated.
 
regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 4 of 6
(3,605 Views)
yes, but not during edit time (only run time).  I expected it to fail during run time.
0 Kudos
Message 5 of 6
(3,598 Views)

Ah,

Ignore the error at edit time because parts of the expression are undefined at edit time and only available at runtime.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 6
(3,589 Views)