VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: Array callback? Corre (3 replies, 0 views) (2000-Sep-30) There are several ways you could speed up such a search. One of the fastest would be by implementing a hash table (you should be able to find info about this on the net) and they are not hard to do.
Another way would be to make use of the Collection class, which uses fast lookup techniques (I think it actually uses a hash table).
Dim PlayerIds As Collection
Dim PlayerArray() as Whatever
Function FindPlayer(Id as String)
FindPlayer=PlayerIds(id)
End Function
When adding a player to the PlayerArray, you should also do this
PlayerIds.Add Index,Id
where index is the index you are adding to the playerarray, and Id is that players id
/Corre, MiCo Games
http://www.micogames.com
|