Re: put one array after another

2016-08-12 Thread Bob Sneidar
Not sure if it would help, but I wrote two functions that are able to convert arrays into strings and then back into arrays again. It works with nested arrays too. They could be used to create an array merging function where you could tell a 3rd function how to perform the merge. Bob S

Re: put one array after another

2016-08-11 Thread Peter M. Brigham
On Aug 11, 2016, at 11:37 AM, Matt Maier wrote: > The way I've been tracking arrays in text for documentation purposes is > basically just a table at heart: > > array[first-key][this-key] = whatever > array[first-key][that-key] = foobar > array[2nd-key][some-key] = data > array[2nd-key][another-o

Re: put one array after another

2016-08-11 Thread Matt Maier
I second the vote for a YAML library. It makes text and arrays work together a lot better than JSON. The way I've been tracking arrays in text for documentation purposes is basically just a table at heart: array[first-key][this-key] = whatever array[first-key][that-key] = foobar array[2nd-key][so

Re: put one array after another

2016-08-11 Thread Richard Gaskin
Quentin Long wrote: > I don't know if there's a command that will do the job. However, > there's a construction I use when I merge two list variables into one: > > put ItemList2 into item (1 + the number of items in ItemList1) of > ItemList1 > > That construction may seem a little weird, but it d

Re: put one array after another

2016-08-11 Thread Quentin Long
sez Matt Maier : > Is there a command to merge two array variables into one? > > Example: > > tFirstArray[tom] = mot > tFirstArray[jane] = enaj > > tSecondArray[bill] = llib > tSecondArray[name] = eman > > put tSecondArray after tFirstArray > > tFirstArray[tom] = mot > tFirstArray[jane] = ena

Re: put one array after another

2016-08-10 Thread Monte Goulding
I agree that it is union that you want here, however, it is interesting to note that Peter just recently implemented list concatenation using the & operator in LCB. This might have been applicable if you were working with ordered numerically indexed arrays. I’ve been thinking lately about comman

Re: put one array after another

2016-08-10 Thread Bob Sneidar
It will if you union both ways. Bob S On Aug 10, 2016, at 10:58 , Mike Bonner mailto:bonnm...@gmail.com>> wrote: Try union union firstarray with secondarray though if you have duplicate keys, the duplicate will not change the current. ___ use-liveco

Re: put one array after another

2016-08-10 Thread Mike Bonner
Try union union firstarray with secondarray though if you have duplicate keys, the duplicate will not change the current. From the dictionary... local tLeft, tRight put "green" into tLeft["color"] put "left" into tLeft[ "align"] put "blue" into tRight["color"] put "100" into tRight["width"] union

Re: put one array after another

2016-08-10 Thread [-hh]
> Matt Maier wrote: > Is there a command to merge two array variables into one? This works for me: union array1 with array2 [recursively] -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/put-one-array-after-another-tp4707393p4707398.html Sent fr

Re: put one array after another

2016-08-10 Thread Colin Holgate
In other languages there is a concat function to join two arrays. It’s in the glossary, but not there as a function. > On Aug 10, 2016, at 5:41 PM, Matt Maier wrote: > > Is there a command to merge two array variables into one? > > Example: > > tFirstArray[tom] = mot > tFirstArray[jane] = e

Re: put one array after another

2016-08-10 Thread Tore Nilsen
I don’t think append is a command, it is used when you open files to add new data at the end of the file. — open file myFilePath for append Tore > 10. aug. 2016 kl. 19.05 skrev Matt Maier : > > Thanks Tore, yeah that works. I was just curious if there was a way to do > it directly. Anytime the

Re: put one array after another

2016-08-10 Thread Matt Maier
Thanks Tore, yeah that works. I was just curious if there was a way to do it directly. Anytime the syntax is simpler there are fewer chances to make a mistake. I found "append" in the dictionary but it's not really documented and I couldn't get a script to compile with it. On Wed, Aug 10, 2016 at

Re: put one array after another

2016-08-10 Thread Tore Nilsen
You could try this, it works if the array is declared global or local, and should work if the arrays are script local if both arrays are constructed within the same handler repeat for each key tKey in tSecondArray put tSecondArray[tKey] into tFirstArray[tKey] end repeat Regards Tore > 10.

put one array after another

2016-08-10 Thread Matt Maier
Is there a command to merge two array variables into one? Example: tFirstArray[tom] = mot tFirstArray[jane] = enaj tSecondArray[bill] = llib tSecondArray[name] = eman put tSecondArray after tFirstArray tFirstArray[tom] = mot tFirstArray[jane] = enaj tFirstArray[bill] = llib tFirstArray[name] =