WebiWan wrote: ↑
Wed Jan 01, 2020 7:34 pm
The only thing I can think of is the subkeys are not numbered, they are named.
Bingo. A name may include alphabetic characters or numerals or punctuation or any combination of those. But it only has one name.
If you name it "Steve" and you ask for "Bob", Steve will not answer.
Same if you name it with the string "CompName" and ask for it with the string "3".
Had we seen the code populating the array this would have been immediately evident.
But I assumed indexing them with a number would work. Like any good array should.
There are two main types of arrays in computer science: indexed and associative.
Neither is "good" or "bad". They each have a useful role.
Indexed arrays have no name, addressed by ordinal position in a linked list, expressed as an integer.
Associative arrays are name-value pairs.
While LiveCode Builder offers both, LiveCode Script currently offers only associative arrays.
Retrieve its value with the same name you set the value with and you'll always get what you want.
Note: I've been working with LiveCode since before version 1.0, and as community manager maintain a close relationship with both the core dev team and much of the community. Through the experience gained from these communications over the years I've found that most recommendations to revert to an earlier version to attempt to solve a problem which appears vastly pervasive and omni-platform are incorrect. In such cases it helps to following diagnostic guidance, which usually yields a simple syntax error in the script, as was the case here.
This is not to suggest LiveCode is the only software of its magnitude without bugs. Far from it. But the combination of automated testing and community testing usually keeps bugs in any released version to those far more specialized in nature.