-
Ok, I've got this control I've made, and one of the most important factors to its success is speed. The fastest way to make something fast, in terms of knowing which item to pick from of a group, is to avoid searching and a whole lotta items for one particular need.
So, in short, I have an array of dates, and I want to know if a particular date is already within it without checking all of the separate values. How can I do this, or whats another way of doing the same thing?
-
I would a Collection with CStr(Date/Time) as a Key, but it will work slower then array.
-
Can you in any way sort your array,
and then compare with only the max / min values?
-
Ok, think about it in this respect. Lets say I have all these dates stored as separate files in a directory. Lets say each file name is somehow determined from the date that it represents. So, as each situation arises where I come accross a point in the graph where I'd want to know if there's a point of information, something like:
Open "C:\whatever\" + Str(Date) + ".txt" For Output as #1
So if that file didn't exist, then an error handler would do something on the error that it doesn't exist; otherwise there's a file and that means there's a point. No searches required.
Although that sounds like a solution to my problem, it's NOT. I don't want to create a buttload of files, so please, creative geniouses, ideas?