NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Property loader formats a tring as a numeric

I'm using a standard property loader, and it's converting my sting to a numeric and then back to a string.  Confused?  Me too 🙂

 

Here's an example: if I have a property file that looks like:

 

<Step Name>
<Locals>      Variable Value
DSP_Version      1.0
Software_Version      v1.0A

 

...and I use the standard property loader to load both locals into string locals, the Locals.Software_Version loads correctly as "v1.0A", but the Locals.DSP_Version loads as "1".  I know I can put "s around the 1.0 in the file as a workaround, but this strikes me as a bug - it looks like the property loader recognises the 1.0 as a numeric, converts it to an integrer, and then back to a string when it goes into the local.





Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 1 of 4
(3,362 Views)

The property loader expects strings to be quoted (and escaped if necessary).

 

If you use Tools>>Import/Export Properties to create your file, it will quote the exported strings. It looks like the quotes were removed from your file.

0 Kudos
Message 2 of 4
(3,338 Views)

@James Grey wrote:

The property loader expects strings to be quoted (and escaped if necessary).


I know - and I think that's unexpected behaviour.


@James Grey wrote:

If you use Tools>>Import/Export Properties to create your file, it will quote the exported strings. It looks like the quotes were removed from your file.


I know - but my file is never exported by TestStand - that's not my use case.  My file is created by the customer.





Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 3 of 4
(3,319 Views)

Hello crelf,

 

This is expected behavior for TestStand. Even though you have both set as a string variable if you do not have quotes around them it is going to get rid of the digits at the end. Putting quotes around the variable will allow the whole string to be imported. Please let us know if you have anymore questions. Have a great day!

 

Best Regards,

 

Adam G 

National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(3,296 Views)