How to keep track of each unique record in a type?

BlitzPlus Forums/BlitzPlus Programming/How to keep track of each unique record in a type?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

BachFire:

Well, unless you are going to be storing thousands of sites, and have to read thousands of sites every second, I don't think there is any problem with iterating through all your records. Just do a for/next loop, checking if the internet site name in the record type matches the one in the text field.

However, one way to speed things up (NOTE: I wouldn't do it this way, it probably wouldn't speed things up noticably for what you are doing. It would probably speed things up by 66% percent, more or less depending on your array size, but 66% of 1 millisecond isnt much of a differnce.):

Create an array of types, and create a same sized array of ints (the array of integers is to store if a record exists, because there is no TypeExists() command! If a record exists for a specific index, set it to true, if not false).

Then, you hash your internet site name to get an index for your array, and simply write to or read from that record. (remember to check if a record exists and to create a new record if it doesn't already exist).