LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure string starting "<\" - LabVIEW changes the string

Solved!
Go to solution

Hi,

 

I am attempting to parse string lines read from a datafile.  Some strings start with the characters "<\".  When I enter this kind of string as a case in a case structure the string is being changed. 

 

For instance, I enter "<\C" (upper-case C) as my case string, it changes to "<\f".  If I enter "<\c" (lower-case c) as the string it becomes "<c" without the "\".  Other string combinations do other odd stuff. 

 

I am currently using LabVIEW 2012. 

 

Any ideas what is going on?

 

Thanks,

Ian

0 Kudos
Message 1 of 3
(3,205 Views)
Solution
Accepted by topic author IanDeaville(ZF)

Some ASCII characters are unprintable control characters (values below 32). These are sometimes encoded using backslash code and it looks like that's what the case structure is doing - when you input \C, the structure interprets it as "oh, you want the ASCII value 0x0C, which in backslash code is represented as \f (stands for "form feed)". When this is the case, you usually use a \\ to represent the \ character, so you actually need to set the structure to match on "<\\C".


___________________
Try to take over the world!
Message 2 of 3
(3,188 Views)

Thanks for that prompt reply.  I had wondered if it might be something like that, but my experience with escape codes and other special constructs is small. 

 

I will give it a go with double backslash as necessary.

0 Kudos
Message 3 of 3
(3,178 Views)