07-13-2025, 12:26 AM
I have settled on an algorythm which seems simple, accurate and performs fairly quickly to seek out matches in my large and growing data base. I am however still working on the ideas provided to see if I can improve the elegance of the code.
Basically I have created 9 arrays, a PrimaryLine(1 to 10) and 7 Line arrays (ie Line1(1 to10), Line2(1 to 10) etc up to Line7(1 to 10). I filled these arrays with the first 8 lines of data in the data base. The 9th array captures the results of any matches, ie Matching(1 to 100,1 to 7)
Then have a routine which compares the PrimaryLine numbers with each of the following 7 Lines and capture a match and updates the Matching(??) array by 1
Next, the algorythm just rotates all lines up so the PrimaryLine()=Line1(), and Line1()=Line2() and so forth til Line6() = Line7(). Line7() is then filled with an Input from the data base.
If you image there can be any one of 100 events that could occur on any given day of the week, the resultant print out parses out the frequency of each event on a Sunday or Wednesday or Saturday.
Looping through the entire data base was a lot quicker than I expected however I don't think 4500 lines of data is really that large.
Anyway, now onto _True and nesting.
Basically I have created 9 arrays, a PrimaryLine(1 to 10) and 7 Line arrays (ie Line1(1 to10), Line2(1 to 10) etc up to Line7(1 to 10). I filled these arrays with the first 8 lines of data in the data base. The 9th array captures the results of any matches, ie Matching(1 to 100,1 to 7)
Then have a routine which compares the PrimaryLine numbers with each of the following 7 Lines and capture a match and updates the Matching(??) array by 1
Next, the algorythm just rotates all lines up so the PrimaryLine()=Line1(), and Line1()=Line2() and so forth til Line6() = Line7(). Line7() is then filled with an Input from the data base.
If you image there can be any one of 100 events that could occur on any given day of the week, the resultant print out parses out the frequency of each event on a Sunday or Wednesday or Saturday.
Looping through the entire data base was a lot quicker than I expected however I don't think 4500 lines of data is really that large.
Anyway, now onto _True and nesting.

