LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
set the useUnicode to true
put numToChar(2713) into tUni
set the useUnicode to false
put tUni & " SELECTED" into tUni
What this results in is ...
TM
SELECTED
Where "TM" is the trademark symbol, not a checkmark, and there is a "return" inserted in the field for some reason. As far as I can determine, 2713 shd be a checkmark.
What I want is "_/ SELECTED" where "_/" is the checkmark.
dunbarx wrote:I don't even think this is correct, but try:
answer numToChar(18)
Craig Newman
You're right Craig, it's not.
I've tried all the numToChar settings and can't find the checkmark. I'm also concerned that it won't produce the same character on all platforms, whereas Unicode is... well, Unicode.
set the unicodetext of field "wobble" to unidecode("ઙ")
That 'might' put the checkmark in the field. You probably won't be able to see it in a normal 'text' field unless you set the unicodetext part.
There really needs to be a lot more detail provided by RunRev about the various options of the Unicode functions. Because the basics at the BYU (http://revolution.byu.edu/indexgeneric.php) are Ok, but not really in-depth enough. There are a few really good tips buried on this forum, but finding them is quite difficult.
I hope that helps a bit,
Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
I'm using what is now a very dated version 4.53 of LC, which doesn't have all of the newfangled text capabilities, but this might work for ya:
Add a field that can be hidden and paste a unicode checkmark directly into the field, used solely as a container... then copy the contents of the hidden field back wherever you wish for it to be displayed. It may or may not suit your actual needs, so you mileage may vary, but I've attached a simple demo stack to show how it's done.
Works here using LC 4.53 on Windows 8, but untested otherwise.
-Doc-
Edit: Attached the wrong sample file earlier... it now has been replaced.
set the useUnicode to true
put numToChar(2713) into tUni
..because the supplied value shd be decimal, whereas 2713 is the hex code for a checkmark. I should have used 10003.
However, that doesn't work either! From fiddling around some more, I have to conclude this is something to do with character sets, and that the checkmark is only in the Dingbats set.
LC 5.5.3, system font, that is, a new field dragged onto a card.
If I set a custom property of a new field to whatever it is when created (the system font?):
set the testStyle of fld "testField" to the textfont of fld "testField" --new field
and then put numToChar(18) into it, I get a tick.
If I change the textFont to something like geneva, I get something entirely different. But I can always set the textFont back to the testStyle, and the tick returns.
If I set a custom property of a new field to whatever it is when created (the system font?):
set the testStyle of fld "testField" to the textfont of fld "testField" --new field
and then put numToChar(18) into it, I get a tick.
If there is no font set anywhere in the object hierarchy, a field will inherit from the Home stack. If that isn't set, it then uses the system font. The IDE sets the Home stack to use different fonts based on the OS. On Mac it is Lucida Grande 11, but the OP is on Windows which will use a different font. NumToChar(18) is probably some other character on Windows.
If I were doing this I'd use an image source so that the checkmark would be consistent on any OS. Alternately, find out what the square root character is on each supported OS and branch the code to use the appropriate numToChar.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com