Forcing string comparisons, or When is "0" not 0?
Peter W A Wood
peterwawood at gmail.com
Thu Oct 15 22:30:12 EDT 2015
Mark
> On 16 Oct 2015, at 07:26, Mark Waddingham <mark at livecode.com> wrote:
>
> 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.
I should have shown the code that I ran in the message box (multiline):
put "0" + 0 into tVar1
put tVar1 is really an integer
It returned false.
I added a test to my LiveCode tests. It also fails:
MT.startTest "Is Really 1"
put "0" + 0 into tTemp
MT.assert tTemp is really an integer
MT.endTest
Should I open a bug report?
Warm regards
Peter
More information about the use-livecode
mailing list