Page 1 of 1
How to get a checkmark (tick) in a text field?
Posted: Thu Nov 22, 2012 11:42 am
by paulsr
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
Re: How to get a checkmark (tick) in a text field?
Posted: Thu Nov 22, 2012 6:16 pm
by dunbarx
I don't even think this is correct, but try:
answer numToChar(18)
Craig Newman
Re: How to get a checkmark (tick) in a text field?
Posted: Fri Nov 23, 2012 2:06 am
by paulsr
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
Re: How to get a checkmark (tick) in a text field?
Posted: Fri Nov 23, 2012 3:21 am
by dave_probertGA6e24
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
Re: How to get a checkmark (tick) in a text field?
Posted: Fri Nov 23, 2012 3:33 am
by doc
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.
Re: How to get a checkmark (tick) in a text field?
Posted: Fri Nov 23, 2012 4:20 am
by paulsr
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
Re: How to get a checkmark (tick) in a text field?
Posted: Fri Nov 23, 2012 4:26 am
by doc
Paul,
I just tried it and it downloaded just fine... might try it again, sir.
-Doc-
Re: How to get a checkmark (tick) in a text field?
Posted: Fri Nov 23, 2012 4:40 am
by paulsr
Thanks Doc ... I tried several times and recvd the same error, but yes, now it's working.
--paul
Re: How to get a checkmark (tick) in a text field?
Posted: Fri Nov 23, 2012 5:09 am
by paulsr
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
Re: How to get a checkmark (tick) in a text field?
Posted: Fri Nov 23, 2012 7:00 am
by jacque
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.
Re: How to get a checkmark (tick) in a text field?
Posted: Sun Nov 25, 2012 3:57 am
by dunbarx
I get a checkmark with numToChar(18).
Anyone else also?
Craig Newman
Re: How to get a checkmark (tick) in a text field?
Posted: Sun Nov 25, 2012 4:28 am
by doc
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-
Re: How to get a checkmark (tick) in a text field?
Posted: Mon Nov 26, 2012 6:54 am
by dunbarx
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
Re: How to get a checkmark (tick) in a text field?
Posted: Mon Nov 26, 2012 6:05 pm
by jacque
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.