Re: Manipulating parts of a multi-dimensional array

2013-06-16 Thread J. Landman Gay
On 6/16/13 8:07 PM, Monte Goulding wrote: So you want: if there is an element "dog" in tAnimals["mammals"] then Seems like a handy feature Jacque... you really will need to start playing with the engine one of these days ;-) You really don't want to be near me if I ever start learning C. :

Re: Manipulating parts of a multi-dimensional array

2013-06-16 Thread Monte Goulding
On 17/06/2013, at 10:53 AM, J. Landman Gay wrote: > Pretty much, yes. I didn't ask my original question correctly. I want to see > if a particular value is contained in any element at a certain level without > looping through to check each one. Sort of like we can say "if tString > contains "d

Re: Manipulating parts of a multi-dimensional array

2013-06-16 Thread J. Landman Gay
On 6/16/13 6:04 PM, dunb...@aol.com wrote: I think what Jacque wanted was a more direct way to get the elements at any level of a multi-dimensional array. Pretty much, yes. I didn't ask my original question correctly. I want to see if a particular value is contained in any element at a certain

Re: Manipulating parts of a multi-dimensional array

2013-06-16 Thread Dar Scott
I think others have answered this well. Essentially multidimensional arrays are arrays with arrays as elements. x[a][b] = (x[a])[b] However, you might be interested in this enhancement request: Bug 6820 - Pass array element by reference This would allow any level to be passed by reference to u

Re: Manipulating parts of a multi-dimensional array

2013-06-16 Thread dunbarx
it would be useful to have that very thing: put elementsOrArray(theArray,theElement) into newArray as a native function. Craig -Original Message- From: Jacques Hausser To: How to use LiveCode Sent: Sun, Jun 16, 2013 6:40 pm Subject: Re: Manipulating parts of a multi-dimensional

Re: Manipulating parts of a multi-dimensional array

2013-06-16 Thread Jacques Hausser
I'm not sure to understand your question correctly. if your array has four "first level" elements: myArray["a"]myArray["b"] myArray["c"]myArray["d"] and that e.g. myArray["c"] has three "second level" elements myArray["c"]["x"] myArray["c"]["y"]myArray["c"]["z"] which in turn

Re: Manipulating parts of a multi-dimensional array

2013-06-16 Thread dunbarx
Jacque. You are asking for a function "the elements of key[yourKey]" or "the elements of key[yourKey1][yourkey2][yourKey3}" This should be a feature request, like yesterday. Craig -Original Message- From: J. Landman Gay To: LiveCode Mailing List Sent: Sun, Jun 16, 2013 3:27

Re: Manipulating parts of a multi-dimensional array

2013-06-16 Thread Colin Holgate
On Jun 16, 2013, at 3:26 PM, "J. Landman Gay" wrote: > >Suppose I only want to work with [c][x] and all its sub-dimensions. Is there > >an efficient way to extract that into its own array without looping through > >all the [c] keys? Can you borrow b, work on it, then put it back? Like: on m