Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: multiple arrays


Message #1 by "dirk" <oerpie@h...> on Mon, 23 Apr 2001 13:11:16
Hi there,



How can I combine two Arrays into one. They have the same structure. I can 

imagine that it can be done white a loop-function. But I was wondering 

about the easiest and quickest way to do this.



Thank you,

Dirk
Message #2 by "jonas jerndin" <jonas.jerndin@o...> on Mon, 23 Apr 2001 18:46:06
Depends what you want to get out of your arrays, so to say...





Some examples:

'first

for i = 0 to Len(arrayOne)



    Response.Write(arrayOne(i)&" : "&arrayTwo(i))



next



'second

for i = 0 to Len(arrayOne)

   Response.Write(arrayOne(i)&"<br>")

      for j = 0 to Len(arrayTwo)

         Response.Write(arrayTwo(j)",")

      next

    Response.Write(br>")

next



Message #3 by "Peter Lanoie" <planoie@e...> on Mon, 23 Apr 2001 14:22:26 -0400
Depending on what kind of data you have in the array, here's a quick and

dirty way of doing it:



array1 = [1][2][3]

array2 = [4][5][6]



Join both arrays into strings:

1,2,3

4,5,6



Stick them together with another delimiter:

1,2,3,4,5,6



Then Split that to create a merged array:

array3 = [1][2][3][4][5][6]



array3 = Split( (Join(array1, ",") & "," & Join(array2, ",")) , ",")



You might have to change the delimiter if you expect it to occur in any of

the actual data.



HTH,

Peter



-----Original Message-----

From: dirk [mailto:oerpie@h...]

Sent: Monday, April 23, 2001 9:11 AM

To: ASP Web HowTo

Subject: [asp_web_howto] multiple arrays





Hi there,



How can I combine two Arrays into one. They have the same structure. I can

imagine that it can be done white a loop-function. But I was wondering

about the easiest and quickest way to do this.



Thank you,

Dirk

---

SoftArtisans helps developers build robust, scalable Web applications!

Excel Web reports, charts: http://www.softartisans.com/excelwriter.html

File uploads: http://www.softartisans.com/saf.html

Transactional file management: http://www.softartisans.com/saf1.html

Scalability: http://www.softartisans.com/saxsession.html

ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html




$subst('Email.Unsub')




  Return to Index