29-04-2009, 02:59 AM
Here's some code to adjust an array. This could mean boundless / dynamic arrays...
The problem with them is for example:
Player(1 To 1)
When a player logs in it fills the first data, then a second comes in and you do ReDim Player(1 To UBound(Player) + 1) and you just have to loop through the UBound of the Player array...however, here is where adjusting an array comes in.
Say for example player 2 leaves, you just do ReDim Preserve Player(1 To UBound(Player) - 1)...well what if Player 1 leaves? If you just get rid of the last part of the array it will leave the player 1 data and clear the player 2...so you have to switch the array around. Here's a form giving an example of rearranging an array I made:
http://mayhem.auburnflame.com/frmArrayTest.frm
The problem with them is for example:
Player(1 To 1)
When a player logs in it fills the first data, then a second comes in and you do ReDim Player(1 To UBound(Player) + 1) and you just have to loop through the UBound of the Player array...however, here is where adjusting an array comes in.
Say for example player 2 leaves, you just do ReDim Preserve Player(1 To UBound(Player) - 1)...well what if Player 1 leaves? If you just get rid of the last part of the array it will leave the player 1 data and clear the player 2...so you have to switch the array around. Here's a form giving an example of rearranging an array I made:
http://mayhem.auburnflame.com/frmArrayTest.frm