You can use TMaps.
Check the help docs and:
http://blitzbasic.com/Community/posts.php?topic=79711
Or you can use TLists. It's a bit easier.
I have thrown together a simple example:
Check the help docs and:
http://blitzbasic.com/Community/posts.php?topic=79711
Or you can use TLists. It's a bit easier.
I have thrown together a simple example:
SuperStrict ' always use it! Type TDatabase Field dvdlist:TList = New TList Method AddDVD(nameofDVD:String, publishedyear:String) ' create a new type Local newdvd:TDVD = New TDVD newdvd.name = nameofDVD newdvd.year = publishedyear Self.dvdlist.AddLast(newdvd) ' add new type to list End Method ' Method RemoveDVD(nameofDVD:String) For Local dvd:TDVD = EachIn Self.dvdlist If dvd.name = nameofDVD Self.dvdlist.Remove(Self) End If Next End Method ' Method FindDVD:tdvd(nameofdvd:String) For Local dvd:TDVD = EachIn Self.dvdlist ' search whole list for dvd with give name If dvd.name = nameofdvd Return dvd End If Next End Method End Type Type TDVD Field name:String Field year:String End Type ' Main Local mydatabase:TDatabase = New TDatabase ' create a new database mydatabase.AddDVD("Matrix", "1999") ' add some data Local movie:TDVD = mydatabase.FindDVD("Matrix") ' search database for movie Matrix Print movie.year