Forcing string comparisons, or When is "0" not 0?
Mark Waddingham
mark at livecode.com
Thu Oct 15 19:26:04 EDT 2015
I think that is a combination of precedence ('is really a' binds more tightly than '+') and the bug Paul noticed with regards 'constants' which are currently represented as strings internally except in specific cases due to a rather subtle issue with representations of numbers as strings.
Sent from my iPhone
> On 15 Oct 2015, at 23:47, Peter W A Wood <peterwawood at gmail.com> wrote:
>
> Mark
>
>> On 16 Oct 2015, at 01:07, Mark Waddingham <mark at livecode.com> wrote:
>>
>> put "0" + 0 into tVar1 -- tVar is really a number
>> put "0" & 0 into tVar2 -- tVar is really a string
>> put tVar1 is really tVar2 -- false
>
> The current implementation appears to differ a little from the above. You need to specify integer or real as number is not currently supported.
>
> When I try “0” + 0 in the message box only “is really a string” returns true, “is really an integer” returns false.
>
> Warm regards
>
> Peter
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list