Again, the VALUE is not being converted by numberFormat, so it ISN'T the LOOP calculation that is doing it! Otherwise the VALUE would ALSO be 1! I loop is using i and it clearly contains 1 and not 01 because that is what shows up in the value. I could put it the otherway. I could say I expected the VALUE to ALSO be 1 because this is how numberFormat shoud work, and it isn't.
But I agree numberFormat should be deprecated. Time to work on that formatNumber function! Bob S On Apr 21, 2017, at 24:26 , Mark Waddingham via use-livecode <use-livecode@lists.runrev.com<mailto:use-livecode@lists.runrev.com>> wrote: As others have already said, this isn't a bug - just a consequence of the rules previously mentioned. The engine is doing this: repeat with i = strToNum(1) to strToNum(10) put i into myArray[numToStr(i)] end repeat So, the value of the key is put into the array as a number but array keys are always strings, so it is converted to a string before indexing the array. _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode