Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adjusting an array
#1
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)