curious "go to" behaviour

Dar Scott dsc at swcp.com
Thu Apr 29 13:08:40 EDT 2004


On Thursday, April 29, 2004, at 03:01 AM, Jacques Hausser wrote:

> Other scripts of this stack use card names in variables (including "KF 
> 0") without problems. It's not a question of life and death, but I'm 
> puzzled...
>
> Thank you for any hint!

This is a wild guess.

Array keys are strings.  The property numberFormat is applied to any 
result of arithmetic to make the key.  If you use the default 
numberFormat and keys are always the result of arithmetic, then the 
keys for numbers will be the same for any two values that are equal 
numerically.

However, sometimes in loops the initial value is not the result of 
arithmetic.  If it is, say, "00" " 0" or "0.", then there might not be 
a match.

This can apply to either the building of arrays or the creation of keys 
for later lookup.  You can check in the building of the array by 
dumping the keys.

Dar Scott




More information about the use-livecode mailing list