Problem deleting element of array

Phil Davis revdev at pdslabs.net
Thu Oct 17 16:27:15 EDT 2013


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





More information about the Use-livecode mailing list