NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a string veriable. Can I set its content to another veriable?

Hi
 
In a string variable defined in TestStand, you normally enter a sting.  TestStand add the quotes around your data.  For example you put ABC and you get "ABC".
 
I have a situation where I want to put a formula instead of a sting.  For example   Str(locals.integerA).  If I enters this data I get "Str(locals.integerA)" which is, obviously not what I want.....
 
Is there a way around it?
 
 
Thanks
 
Rafi
0 Kudos
Message 1 of 5
(3,409 Views)
Sorry Rafi. I do not understand your problem.
The quotes appear in SeqEdit but they are not part of a string variable's value.
No need to search for a workaround ... (Please correct me if I couldn't catch your point.)
Guenter
0 Kudos
Message 2 of 5
(3,388 Views)
This is not possible.  One way around it is to have an expression and evaluate it.  You will have to use a step to execute this expression.  For your example, you will have to have to execute the expression "Locals.MyLocal = Str(Locals.IntegerA)".

Allen P.
NI
0 Kudos
Message 3 of 5
(3,383 Views)

Rafi,

I am not sure that I understand your question, but I will try to answer it as best I can.

normally if you had a string variable such as 'Locals.String' and you wanted it to contain the value 'ABC' you would write the following expression:

Locals.String = "ABC"

If you had another variable (say a numeric) called 'Locals.integerA' and you wanted a string representation of the numeric content you would write:

Locals.String = Str(Locals.integerA)

The Str() function would convert the numeric value to string representation.

If you were looking for something else, please respond/clarify and I will try to address your concern.

-Sean

0 Kudos
Message 4 of 5
(3,359 Views)

Hi,

If you have a string which contains some expression

eg Locals.MyString ="Str(Locals.IntergerA)"  and the contents of Locals.IntergerA  = 5.

If you use Evaluate(Locals.MyString) in a step, say the datasource of a Numeric Limit Test step, then this will return the value of 5.

Hope this helps

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 5 of 5
(3,345 Views)