How? Pass an 2dim. Array to a function ?

Results 1 to 2 of 2

Thread: How? Pass an 2dim. Array to a function ?

  1. #1
    Ted R. Guest

    Default How? Pass an 2dim. Array to a function ?

    I have defined a 2 dimensional array based on info from a db, now I need to pass the array onto the function that is going to handle it, How can I do that?

  2. #2
    Join Date
    Dec 1969

    Default code snippet..

    Just pass it...<BR><BR>&#060;SCRIPT language="javascript" RUNAT="SERVER"&#062;<BR><BR> //DEFINE THE CODE<BR> function a()<BR> {<BR> //Define the array<BR> var arr_One = new Array(2);<BR> arr_One[0]= new Array(2);<BR> arr_One[1]= new Array(2);<BR><BR> //Populate the array<BR> arr_One[0] [0]=&#039;THIS &#039;;<BR> arr_One[0] [1]=&#039;IS &#039;;<BR> arr_One[1] [0]=&#039;A &#039;;<BR> arr_One[1] [1]=&#039;TEST &#039;;<BR> <BR> b(arr_One);<BR> }<BR><BR> function b(passed_Stuff)<BR> {<BR> //Output the passed array contents....<BR> Response.Write(passed_Stuff[0][0] + passed_Stuff[1][0] + passed_Stuff[1][1] + passed_Stuff[1][1]);<BR> }<BR><BR><BR> //RUN THE CODE<BR> a();<BR><BR>&#060;/SCRIPT&#062;

Posting Permissions

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