Combining arrays 
Author Message
 Combining arrays

Is there a simple way to combine two 1-dimensional arrays to create a
single 1-dimensional array.  I don't care about the ordering within the
array, or anything.  Or, should I just loop through one and add it to
the other (or a third array that is dimensioned properly, or something
similar)?  Thanks in advance.


Sat, 22 Feb 2003 22:28:44 GMT  
 Combining arrays
hi John,

I can't think of any way, except for the "brute force approach" that you
mentioned.

If you plan to do this extensively, you might consider a "higher level
language", such as ms's Excel product, which is easily scriptable, and
provides the capability of moving arrays around easily.

cheers, jw


Quote:
> Is there a simple way to combine two 1-dimensional arrays to create a
> single 1-dimensional array.  I don't care about the ordering within the
> array, or anything.  Or, should I just loop through one and add it to
> the other (or a third array that is dimensioned properly, or something
> similar)?  Thanks in advance.



Sat, 22 Feb 2003 22:58:51 GMT  
 Combining arrays

foo = array("f","o","o")
bar = array("b","a","r")

foobar = split(join(foo,"|") & "|" & join(bar,"|"),"|")

msgbox join(foobar,vbcrlf)
msgbox join(foobar,"")

--
Michael Harris
Microsoft.MVP.Scripting
--


Quote:
> Is there a simple way to combine two 1-dimensional arrays to create a
> single 1-dimensional array.  I don't care about the ordering within the
> array, or anything.  Or, should I just loop through one and add it to
> the other (or a third array that is dimensioned properly, or something
> similar)?  Thanks in advance.



Sun, 23 Feb 2003 05:32:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Combining arrays

2. Combining arrays into one

3. Combining Arrays - Please Help

4. combining two arrays

5. Combining values from array

6. Combining Index and Control Array?

7. help arrays- access - textboxes how can i combine?

8. wsh/ jscript : BUG : array of array, 2D array

9. Arrays in Collections, Arrays in Arrays

10. Array of Arrays and 2D array

11. How can i combine Guestbook and Email form together

12. how to combine pen thickness and rgb values

 

 
Powered by phpBB® Forum Software