Strange array behavior

Timothy Bleiler bleiler at buffalo.edu
Tue Dec 17 11:09:47 EST 2013


I had a problem similar to this about a month ago. It got bug reported as #11425. My problem was that when I deleted a key, the entire array was being emptied. I worked on it with RunRev but we were unable to find a reliable recipe to recreate the problem. 

My "bad" array was being created from a custom property set and I suspected some kind of stack corruption but we could not recreate it.

My solution is odd but it worked. I wrote a repeat loop through the keys of the "bad" array and rewrote them into a new array variable, then performed the necessary actions on the new variable which did not get emptied.  In my case since the bad array originated in a custom property set, I also cleaned up the custom property by deleting the custom property set and creating a new one to store the new array. I have not had the problem reoccur since I did this "solution."

I hope this helps you find a solution to your problem.

Good luck,

Tim Bleiler, Ph.D.
Instructional Designer, HSIT
University at Buffalo

On Dec 16, 2013, at 10:32 PM, Peter Haworth wrote
> I have a script local variable which is an array plus a set of handlers in
> the script to maintain it.  The array has 2 levels of key, the first being
> a number and the second being various text values.
> 
> This set up has been working fine for a long time but I just wrote some new
> code which calls the array handlers to insert new keys.  At the end of the
> new code, I see that the array is empty, in other words it has no keys; it
> is keyless; it's an ex array.
> 
> When I step through the code that inserts keys into the array in debug, I
> see the disclosure triangle appear in the debug variables tab after the
> line to insert a key is executed but as soon as I click on the disclosure
> triangle, it disappears and the array is empty again.
> 
> The normal inspiration for a solution to weird problems like this (a glass
> of good 15 year old Scotch) has not yet yielded any revelations and I'm at
> the point of diminishing returns, so I'm hoping someone out there might
> have run into this or be able to suggest some possible solutions.
> 
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> _______________________________________________
> 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