How to empty an array structure?
I have a very big array structure in livecode, like: temp["A"] temp["A"]["B"] temp["A"]["B"]["c"] temp["A"]["D"] temp["A"]["D"]["E"][...] ... I want to preserve the structure, but just put empty in the values. What recursive procedure should I use? I don't know how to pass arrays recursively.
I found my problem, I can't alter the same array that I'm travelling using repeat or recursive functions. I need to use 2 arrays, the second is the empty copy of the first. So this is the code: function svuotaArray tarr repeat for each key tKey in tArr put empty into tArr2[tKey] put svuotaArray(tArr[tkey]) into tArr2[tkey] end repeat return tArr2 end svuotaArray
Hmm... something like the following (untested) should work in current releases of LiveCode. I can't remember the release that added the ability to pass array elements by reference though: command ClearElements #xArray if xArray is an array then repeat for each key tKey in xArray ClearElements xArray[tKey] end repeat else put empty into xArray end if end ClearElements
Max. Something like this: on mouseUp repeat with y = 1 to 10 repeat with u = 1 to 10 put random(99) into myArray[u][y] end repeat end repeat breakpoint--to see array repeat with y = 1 to 10 repeat with u = 1 to 10 put "" into myArray[u][y] end repeat end repeat end mouseUp
Visual effect dissolve support desktop in Livecode?
How can I add a checkbox to a datagrid column
answer file dialog not recognizing cancel
How to find stack of Project Browser ? - livecode
How to filter list file with type image ? - Livecode
How to adding and append code on runtime ? - livecode
How to add CKEditor for input field ? - Livecode
How to create player and set autoplay with code at runtime?
How do smooth when scrolling group? - livecode
How to add custom options menu when Right Click on edit tool - Livecode
How do I join multiple words in LiveCode
How to upload file to a server with php - Livecode
native android scroller for 3-4 fields on 1 card does not work
specialFolderPath(“Users/myname”) is not working - Livecode
How to adding code to object at runtime ? - Livecode
How to import image by import as control at runtime in Livecode?