Problem deleting element of array

Timothy Bleiler bleiler at buffalo.edu
Thu Oct 17 22:54:37 CEST 2013


Thanks for trying. I am suspicious that there's something abnormal about the problematic array, but no joy on the NULL lead. 

A search for NULL in the problematic array found no NULL characters either in the keys or any content of an element.  In version 6.1.1, putting NULL into the contents of an array element and even using NULL as a key did not break my simple script example.

Tim


On Oct 17, 2013, at 4:27 PM, Phil Davis wrote:

> If an array element contains NULL characters (hex 00) that could cause array problems. At least I've seen issues with that in the past - don't know about 6.x.
> 
> Phil
> 
> 
> On 10/17/13 12:59 PM, Timothy Bleiler wrote:
>> Thanks Phil,
>> 
>> 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.
>> 
>> Tim
>> 
>> 
>> 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"
>>> 
>>> Phil
>>> 
>>> 
>>> 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?
>>>> 
>>>> 
>>>> Thanks,
>>>> 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:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>> 
>>> -- 
>>> Phil Davis
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> -- 
> Phil Davis
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 




More information about the use-livecode mailing list