The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#10
|
||||
|
||||
![]() Quote:
So like... Code:
var friends = new Array(); friends[0] = "Woody"; friends[1] = "Buzz"; friends[2] = "Potato Head"; friends[3] = "Rex"; friends[4] = "Hamm"; friends[0] = "Slinky"; friends[6] = "Bo Peep"; You can also use 2D arrays to make arrays of arrays. This is to keep track of checkerboard kind of things. Code:
var timestable = new Array(3); for(var i=0; i<6; i++){ timestable[i] = new Array(5) } for(var i=0; i<timestable.length; i++ { for(var j=0; j<timestable[0].length; j++) { timestable[i][j] = i * j; } } document.writeln("2 x 3 = " + timestable[2][3]); Code:
0 1 2 0 [0][0][0] 1 [0][1][2] 2 [0][2][4] 3 [0][3][6] 4 [0][4][8] So MarkFoster here can solve his problem either with a two arrays or a 2D array. Either way, he has to extensively change his code. Because the list probably isn't very long, and he would only need two rows - using a 2D array would be wasteful and inefficient. He probably needs to just keep two arrays (which is what I've given him code for). |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|