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
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
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
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
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
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
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
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
> 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
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
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
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
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.
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] =
14 matches
Mail list logo