numberFormat affecting array keys???

Paul Dupuis paul at researchware.com
Thu Apr 20 20:07:05 EDT 2017


Array keys are strings. Even when you: put 1 into tArray[1] the "1" as
the array key is a string. If you do something mathematical to that key,
LC converts any string that represents a number to a number when it
needs to.

On 4/20/2017 7:51 PM, Bob Sneidar via use-livecode wrote:
> Hi all. 
>
> Put this into a button:
>
> on mouseUp
>    set the numberFormat to "00"
>    repeat with i=1 to 10
>       put i into myArray [i]
>       breakpoint
>    end repeat
> end mouseUp  
>
> At the breakpoint examine the array. There will be a 1 in an element with the name... ready??? "01"
>
> Okay THAT has GOT to be a bug!!! Why the hell is numberformat modifying the name of the array element?? I haven't done ANY math on it. Apparently the engine DOES! 
>
> Bob S
>
>
>
> _______________________________________________
> 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