LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Character name/description from Character symbol

Solved!
Go to solution

Hi,

This may sound a bit unusual, but probably someone already did this.

 

Is there any way to show the description or name of a character that was just typed in the String control?

 

So for example, if I type " ", the description is "<space>", and if I type "," then the description is "comma".

Yes, I can build this through a case structure on my own, but if it's possible to fetch from some existing database (like the Char mapping), then it's better. Because on my own, I may miss some character and after all, it's a lengthy process.

 

Thanks and Regards,

 

Vaibhav
0 Kudos
Message 1 of 6
(3,034 Views)
Solution
Accepted by topic author Vaibhav

Hi Vaibhav,

 

use a lookup table with the U8 value of the char as pointer into the table.

 

You can create that "table" as 1D array of strings - which is much easier to create when using a usual text editor to create a txt file and reading the file using ReadSpreadsheetFile…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,018 Views)

Here's a table which may give you a start

http://www.ascii.cl/htmlcodes.htm

 

MC

Message 3 of 6
(2,995 Views)

Hi GerdW and MC,

 

Thanks.

 

Char_to_ASCIIDescription.png

 

 

I found my complete table on the http://www.theasciicode.com.ar/ page.

 

It's a pity I cannot use the UNICODE characters in LabVIEW, alongwith other simple characters. I must change the whole text's font to Symbol, for example to use Greek letters in between other text controls (like Enum or String or Tree View), as I asked in another thread. That would have been really good.

 

 

Regards,

Vaibhav
0 Kudos
Message 4 of 6
(2,971 Views)

Be careful what ASCII table you use.  The extended characters (decimal 128 and above) can vary.

 

Here is a different table that I would say is much more commonly used.  http://www.cheat-sheets.org/saved-copy/ascii_a4.pdf and matches what is showing up on my PC.

Message 5 of 6
(2,962 Views)

Hi,

 

Thanks. Already saved.

 

Actually, I used that page that I mentioned only because of the readily available descriptions. Will update the list with more time at hand, and use the more reliable source.

 

Vaibhav
0 Kudos
Message 6 of 6
(2,958 Views)