NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to print "\t" in teststand

I am using TestStand 3.5. I want to print "sw\test\nis" in the final report. I am using Step.Result.ReporText = "sw\test\nis".

But in the final report, \t in the string is recognized as tab and the final report displaying is

sw est\nis.

 

One option is to use a variable and store its value before executing the sequence, but I want to use it at runtime.

Can you please help how I can achieve this functionality?

0 Kudos
Message 1 of 4
(4,544 Views)

You need to take care about escape characters.

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(4,539 Views)

NOTE:

1) String literals in expressions, as in many C-based programming languages, use the '\' character as an escape character, thus the string you need if using an expression string literal is "sw\\test\\nis"

2) Setting string variables directly in the variables view however does not involve escaping so when you are setting a string variable directly in the variables view using sw\test\nis is what you want.

 

Hope this helps,

-Doug

0 Kudos
Message 3 of 4
(4,529 Views)

Ecape character works.

Thanks for your help

0 Kudos
Message 4 of 4
(4,501 Views)