Problem deleting element of array
bleiler at buffalo.edu
Thu Oct 17 21:59:01 CEST 2013
Yes the entire array is being wiped out. "Get MyArray is an array" puts False into "it".
The offending line is in a loop and it works most of the time! It does occur at the exact same point in the loop but there isn't anything unusual about the array that is being manipulated that I can see. The engine is just wiping it out when it's supposed to just delete one element. I've never seen anything like it with Livecode in the 15 or so years I've been using it.
On Oct 17, 2013, at 3:30 PM, Phil Davis wrote:
> Just FYI - If you say "if myArray is empty" in pre-6.0 versions of LC you will get true, even when it has elements. Try "if myArray is an array"
> On 10/17/13 11:39 AM, Timothy Bleiler wrote:
>> I have a script that deletes an element from an array.
>> Delete variable MyArray [ "MyElement" ]
>> Instead of deleting just "MyElement", "MyArray" is being set to empty.
>> I can not duplicate the problem in any other script. The problematic line behaves correctly in other simple scripts. Is there some setting that I'm missing that could cause this? If not is there any way to get the "bad" script to behave properly?
>> Tim Bleiler, Ph.D.
>> Instructional Designer, HSIT
>> University at Buffalo
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> Phil Davis
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode