Oct 25, 2000 #1 PepperPepsi Programmer Joined Aug 3, 2000 Messages 241 Location US Hi, can anyone please tell me how to create an 2D array in JScript? thanks Chiu Chan cchan@gefmus.com http://www.gefmus.com
Hi, can anyone please tell me how to create an 2D array in JScript? thanks Chiu Chan cchan@gefmus.com http://www.gefmus.com
Oct 25, 2000 #2 khorjak Programmer Joined Oct 9, 2000 Messages 65 Location US To create a 2D 3x3 array: Code: myArray = new Array(2) myArray[0] = new Array(2) myArray[1] = new Array(2) myArray[2] = new Array(2) To assign values to elements in the arrays: Code: myArray[0][0] = "this" myArray[0][1] = "that" You're actually creating an array within each element of the first array. HTH Choo Khor choo.khor@intelebill.com Upvote 0 Downvote
To create a 2D 3x3 array: Code: myArray = new Array(2) myArray[0] = new Array(2) myArray[1] = new Array(2) myArray[2] = new Array(2) To assign values to elements in the arrays: Code: myArray[0][0] = "this" myArray[0][1] = "that" You're actually creating an array within each element of the first array. HTH Choo Khor choo.khor@intelebill.com
Oct 26, 2000 Thread starter #3 PepperPepsi Programmer Joined Aug 3, 2000 Messages 241 Location US ChooKhor, thanks for your reply, however, that is in JavaScript, not JScript Array[x][x] don't work for JScript Chiu Chan cchan@gefmus.com http://www.gefmus.com Upvote 0 Downvote
ChooKhor, thanks for your reply, however, that is in JavaScript, not JScript Array[x][x] don't work for JScript Chiu Chan cchan@gefmus.com http://www.gefmus.com