Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seeking Matches in a Data Base
#10
I agree..totallines is not the same variable as total_lines.

The commented out line of 
Code: (Select All)
'Dim Shared dataarray(1 To 100, 1 To totallines)
intended to remove the underscore from both the array "dataarray()" and the variable "totallines". The intent was to use the underscored array and variable so that the routine was as close to the original code provided which was triggering an Out of Range error.

The "For i = 1 to total_lines should have worked??? because it was the correct variable to use in the assignment of ...data_array(Num(j),i) = _TRUE... and "Num(j) should have fallen with the range of 1 to 100, while i should have fallen within the range of 1 to total_lines. Why that generated an Out of Range error, I don't know.
What I'm shooting for is a comparison and counting. So as an example using the DATA lines, I'm taking the 1st Data line of 1,15,31,25,82.12,63,64,50,47 and compare all those numbers with the next 7 data line (ie Data lines 2 to 8), and if there is a match then I want to count how many times that number appeared in the following 7 lines of data. The number 1 does not appear in any of the following 7 lines so Repeat(1,1 to 7) will all carry a zero value, but if you take the number 12 it does repeat in the 2nd comparison line (data line 3) 
Repeat (12, 2)= Repeat (12,2) +1

So once all of Data line 1 has been compared to the next 7 lines of data the routine needs to use Data Line 2 which is 66,22,18,93,84,88,98,10,6,27, and perform the same comparison and count with the next 7 lines (ie Data Lines 3 to 9). The routine should march one Data line at a time comparing and counting the Repeats in the following 7 lines until the 7th line is the end of the data base.

I haven't yet worked with _TRUE and _FALSE and so not sure why code ...data_array(Num(j),i) = _TRUE is Out of Range, where code line  ...data_array(Num(j),i) = data_array(Num(j),i) +1
May not trigger the same Error ... now I said that and I haven't actually tried it, but hopefully you know what I mean.
Reply


Messages In This Thread
Seeking Matches in a Data Base - by Dimster - 07-03-2025, 04:00 PM
RE: Seeking Matches in a Data Base - by SMcNeill - 07-03-2025, 04:44 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-03-2025, 08:08 PM
RE: Seeking Matches in a Data Base - by SMcNeill - 07-04-2025, 12:16 AM
RE: Seeking Matches in a Data Base - by Dimster - 07-04-2025, 06:24 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-05-2025, 02:40 PM
RE: Seeking Matches in a Data Base - by SMcNeill - 07-05-2025, 04:33 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-06-2025, 02:42 PM
RE: Seeking Matches in a Data Base - by SMcNeill - 07-06-2025, 04:23 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-07-2025, 03:51 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-13-2025, 12:26 AM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)