Combine Two Arrays

Let say we have two array with same items count.

 
arr1 = #("a","b","c","d","e")
arr2 = #(1,2,3,4,5)

Which will be the easy way (sort code) to combine these 2 and get this output

#("a", 1, "b", 2, "c", 3, "d", 4, "e", 5)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

I fixed previous code. I just forgot to convert value to string
(getProperty b p ) as string

bga

SugaR's picture

That's nice :)

That's nice :)

barigazy's picture

...

If you have another idea for usage or any array combo post here and we can continue disscusion.
Cheers!

bga

SugaR's picture

I don't have any for the

I don't have any for the moment, but come back when I will :)

Otherwise, I'd liked to get a bit of improvement of what you've done here:
for now, you print each element of the combined array into separate lines in the txt file, how would you do to print all of the array elements in only one line,with some punctuations, units and the object name at the begining.

For summarize a bit, something like that:
Box01: height: 25cm, length: 25cm, etc...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.