How to concatenate arrays?

Results 1 to 2 of 2

Thread: How to concatenate arrays?

  1. #1
    Join Date
    Dec 1969

    Default How to concatenate arrays?

    I have five arrays of differing sizes that I would like to put into one large array. I have tried the following:<BR><BR>arrayLarge = array1 & array2 & array3 & array4 & array5<BR><BR>Please could somebody tell me the correct syntax for this operation.<BR><BR>Thanks<BR><BR>Tim

  2. #2
    Join Date
    Dec 1969

    Default RE: How to concatenate arrays?

    you cannot join arrays with the "&" operator, strings work this way, i guess you will have to loop through the arrays each time adding elements to a "big" array <BR><BR>alternatively you can use the vbscript "Join(arguments)" function for arrays<BR><BR>I really havent done this myself and so I can just presume this will work ...<BR><BR>so you could say<BR><BR>str1 = Join(ar1, "^")<BR>str2 = Join(ar2, "^")<BR>str3 = Join(ar3, "^")<BR>str4 = Join(ar4, "^")<BR>str5 = Join(ar5, "^")<BR>bigStr = str1 & "^" & str2 & "^" &str3 & "^" &str4 & "^" & str5<BR>bigArray = split(bigStr, "^")<BR><BR>i think you should research the "Join" function more

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts