05-02-2010 02:06 PM
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?
05-02-2010 04:39 PM
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.
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.
05-02-2010 05:16 PM
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:
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.
05-02-2010 05:50 PM
Guess you should post it to the idea exchange. 😉
Felix
05-02-2010 06:09 PM
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
05-03-2010 12:57 AM - edited 05-03-2010 01:07 AM
05-03-2010 01:29 AM
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:
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
05-10-2010 10:42 AM