Compare numeric strings with leading zeros

J. Landman Gay jacque at hyperactivesw.com
Thu Sep 3 01:12:26 EDT 2015


On 9/2/2015 11:49 PM, Ralph DiMola wrote:
> I would have thought 5=005 would evaluate as true and "5"="005" would
> evaluate as false.

LC will read "5" as a number because it will interpret what is inside 
the quotes rather than see the whole thing as a string. You have to add 
the quotes to the string specifically: quote & "5" & quote.

After that, LC wakes up and realizes you really do want a string. I 
think it's a side-effect of using an untyped language.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list