Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seeking Matches in a Data Base
#11
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Must an extra value be provided on DATA statement? dakra137 11 1,036 09-30-2025, 05:38 PM
Last Post: ahenry3068
  Why is 'base' treated like a reserved word in the IDE? Pete 4 787 04-11-2025, 09:49 PM
Last Post: SMcNeill
  Change file data krovit 5 1,186 07-11-2024, 07:45 AM
Last Post: krovit
  Arrays In User Data Types Consolemu 2 859 01-18-2024, 09:49 PM
Last Post: bplus
  Write data to EXE file Steffan-68 8 1,977 05-15-2023, 06:41 PM
Last Post: Steffan-68

Forum Jump:


Users browsing this thread: