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!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
paulsr
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
-
Contact:
Post
by paulsr » Thu Nov 22, 2012 11:42 am
Plz could someone explain to me how I can get a checkmark into a line of text.
I've fiddled around with useUnicode and numToChar but can't get the right result.
Code: Select all
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.
Thanks in advance...
--paul
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10330
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Nov 22, 2012 6:16 pm
I don't even think this is correct, but try:
answer numToChar(18)
Craig Newman
-
paulsr
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
-
Contact:
Post
by paulsr » Fri Nov 23, 2012 2:06 am
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.
Thanks anyways...
--paul
-
dave_probertGA6e24
- Livecode Opensource Backer

- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
-
Contact:
Post
by dave_probertGA6e24 » Fri Nov 23, 2012 3:21 am
Hi,
Just heading to bed so I haven't tested any of this...
Code: Select all
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.
-
doc
- Posts: 148
- Joined: Fri Jun 09, 2006 4:30 pm
Post
by doc » Fri Nov 23, 2012 3:33 am
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.
-
Attachments
-
- Checkmarks.zip
- (1.52 KiB) Downloaded 392 times
-
paulsr
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
-
Contact:
Post
by paulsr » Fri Nov 23, 2012 4:20 am
doc wrote: 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.
Thanks Doc, but "The selected attachment does not exist anymore."
--paul
-
doc
- Posts: 148
- Joined: Fri Jun 09, 2006 4:30 pm
Post
by doc » Fri Nov 23, 2012 4:26 am
Paul,
I just tried it and it downloaded just fine... might try it again, sir.
-Doc-
-
paulsr
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
-
Contact:
Post
by paulsr » Fri Nov 23, 2012 4:40 am
Thanks Doc ... I tried several times and recvd the same error, but yes, now it's working.
--paul
-
paulsr
- Posts: 222
- Joined: Thu Jul 19, 2012 9:47 am
-
Contact:
Post
by paulsr » Fri Nov 23, 2012 5:09 am
First, I was wrong to put:
Code: Select all
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.
So, I tried:
Code: Select all
set the useUnicode to true
put numToChar(8713) into tUni
...which correctly produces a square root symbol ... which for my purposes is close enough to the checkmark.
Thanks for all the thoughts...
--paul
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Fri Nov 23, 2012 7:00 am
I've usually used the square-root symbol too, but an imagesource character is another good alternative if you don't need to scale the text much.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10330
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Sun Nov 25, 2012 3:57 am
I get a checkmark with numToChar(18).
Anyone else also?
Craig Newman
-
doc
- Posts: 148
- Joined: Fri Jun 09, 2006 4:30 pm
Post
by doc » Sun Nov 25, 2012 4:28 am
dunbarx wrote:I get a checkmark with numToChar(18).
Anyone else also?
Sorry Craig... that doesn't work using 4.53 on Windows at least.
-Doc-
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10330
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Mon Nov 26, 2012 6:54 am
Hmmm.
Well, I do. Discovered by accident, actually.
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.
Craig Newman
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Mon Nov 26, 2012 6:05 pm
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