This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

ASCII char. in an objet string
#1
Hi all the LM community,

For my Lua scripts : 
I'm looking for how to insert special characters (ASCII table: eg Ohm, diameter ...) in a "string" object (example type 16.14 oct. ASCII string).
And also how to take LM into account several "space" characters in these strings: by default it concatenates them into a single character.


Any idea ?

BR from France.
Thank's in adance for your answer.
Reply
#2
You can use any UTF-8 characters but it is advised to use 250-byte string object because other type are too short.
Spaces are collapsed by your browser, it's how HTML works. You can use no-break space character to put several spaces together:
Code:
nbsp = string.char(0xC2, 0xA0)
grp.update('32/1/1', '123' .. nbsp .. nbsp .. 'Ω')
Reply
#3
Ok, that's why it doesn't give the expected result with string.char (32) !
Now it runs correcly with your code.
Thanks again.
Reply


Forum Jump: