LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Display Format Specifiers?

I am aware that numerics have display format specifiers (as shown in picture), but I'm wondering if there's a similar function for getting the display formats of strings?

 

I have shown what I want the output to be (although that output was clearly not generated by the code!). So, can I replace the ???'s with some valid format specifiers? 

 

StringFormatSpecifiers.png 

0 Kudos
Message 1 of 8
(5,964 Views)

Hi JackDunaway,

 

What an interesting question.

 

I don't believe using that block you can... if you double click on it you can see what formating you can achieve.

 

Capture.PNG 

 

However,  you can get these formatting options using a property node of the string indicator.

 

You can do this by right-clicking the string indicator >>  Create >> property node >> Display Style then place the block. Right click and change to write ..

 

Content Help:

 

"Sets the display style of a string object. Valid values include 0 (normal), 1 (backslash '\' codes), 2 (password), and 3 (hex). You cannot write to this property when the referenced string control has key focus.

This property

 

Hope this is what your after.  

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 8
(5,946 Views)

Thanks for the reply! Well, yes, I'm aware of one "bad" way this can be accomplished, by using the "Text.Text" property of some dummy string indicators:

 

StringFormatDisplays.png 

 

Instead, I'm wanting some cleaner syntax. Needing to introduce a dummy indicator just to hijack a property of that object is a bit messy.

 

Looking at my example, one might argue "Well you only need one dummy string in a For Loop of 4 iterations, setting the Display Style from 0-3. That way you don't need four dummies." Right, but the principle remains... I'm interested in a Format Specifier (or potentially a VI hidden in vi.lib?) that eliminates the need for a dummy indicator.

Message 3 of 8
(5,939 Views)

Guess you should post it to the idea exchange. 😉

 

Felix

0 Kudos
Message 4 of 8
(5,932 Views)

F. Schubert wrote:

Guess you should post it to the idea exchange. 😉

 

Felix


 

 

 

What is this "idea exchange" you speak of? I suppose I shall do some investigation into said "exchange" if I cannot get an answer by tomorrow or so. 😉

 

Thanks,

Jack

Message 5 of 8
(5,929 Views)

 

 

Message Edited by Lucither on 05-03-2010 01:07 AM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 6 of 8
(5,908 Views)

Hi Jack,

 

I have written something along the lines of what you are wanting. It doesnt require you to write to a 'Dummy' Indicator as such:

 

Convert string format snippet.png

 

Convert format example.png

 

Of course the refnum is not in the original, just something that labview does when converting to snippet.

 

The property node is the node for the 'Output' indicator, so not technically a dummy indicator as you would require this in the sub vi anyway.

 

Maybe not what you are after but works.

 

Rgs,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 7 of 8
(5,897 Views)
For anyone interested in adding this native ability: String Display Format Specifiers on the Idea Exchange
0 Kudos
Message 8 of 8
(5,813 Views)