Re: Using a value as a key in array
Posted: Wed Jan 08, 2020 11:24 pm
Integer names for objects are problematic in some cases because LC allows us to refer to objects by ordinal number, creating an ambiguity about how the object is being addressed.dunbarx wrote: Wed Jan 08, 2020 10:58 pm Jacque.
A fair point. And if one is careful, one can surely use numbers, even with field names.
But I would still do what we both have advised in the past, maybe something like “p1”?
Array keys are always strings, even if characters in the string are numerals. We don't currently have indexed arrays in LC Script, only associative arrays, so there's no ambiguity in addressing them.