Good night people...
I need help with two questions:
1a. Relying on the routine below:
SELECT linresul
DELETE ALL
PACK
APPEND FROM linresul.txt DELIMITED WITH CHARACTER "-"
GO vsor-1
SCATTER FIELDS linresul.d01, linresul.d02, linresul.d03, linresul.d04, linresul.d05, linresul.d06, linresul.d07, linresul.d08, linresul.d09 ,;
linresul.d10, linresul.d11, linresul.d12, linresul.d13, linresul.d14, linresul.d15 TO arr01
SELECT lifiltro
DELETE ALL
PACK
APPEND FROM linfingr.txt DELIMITED WITH CHARACTER "-"
replace ALL lifiltro.rep WITH 0
SELECT libackup
DELETE ALL
PACK
SELECT lifiltro
SET ORDER TO lifiltro
COUNT ALL TO vban
GO TOP
DO WHILE! EOF ()
WAIT WINDOW "PLEASE WAIT !!! Separating CONFIGURED LINES from the file into GROUPS and their REPTIMENTS ..." + ALLTRIM (STR (vreg)) "+" from "+ ALLTRIM (STR (vban)) NOWAIT
SCATTER FIELDS lifiltro.d01, lifiltro.d02, lifiltro.d03, lifiltro.d04, lifiltro.d05, lifiltro.d06, lifiltro.d07, lifiltro.d08, lifiltro.d09 ,;
lifiltro.d10, lifiltro.d11, lifiltro.d12, lifiltro.d13, lifiltro.d14, lifiltro.d15 TO arr02
FOR i = 1 TO 15
var1 = arr01
FOR j = 1 TO 15
var2 = arr02 [j]
IF var1 = var2
var3 = var3 + 1
ENDIF
ENDFOR
ENDFOR
IF var3> 0
replace lifiltro.rep WITH var3
ENDIF
var1 = 0
var2 = 0
var3 = 0
IF! EOF ()
SKIP
vreg = vreg + 1
ELSE
EXIT
ENDIF
ENDDO
Notice I have two scatters, both creating two arrays, right?
In this routine, FOR counts between the two arrays, the same quantities, however, one by one element until completing 15 and that in a file with more than 1 million records, is very time consuming.
Question:
There is how to count the elements without using FOR, counting the set for example:
ARRAY01 will have all 15 elements = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
ARRAY02 will have another 15 elements = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 16
Note that FOR would count the 15 elements of each array between them, finding 14 equal between the two.
Can you count the elements of the arrays without using FOR, take the whole array01 and find the equals in array02?
With FOR it gets very slow ...
2a. On the basis that:
ARRAY03 will have all 15 elements = 01 02 03 07 08 10 05 06 09 04 11 12 13 14 15
How to make this array be sorted as follows = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15?
I need help with two questions:
1a. Relying on the routine below:
SELECT linresul
DELETE ALL
PACK
APPEND FROM linresul.txt DELIMITED WITH CHARACTER "-"
GO vsor-1
SCATTER FIELDS linresul.d01, linresul.d02, linresul.d03, linresul.d04, linresul.d05, linresul.d06, linresul.d07, linresul.d08, linresul.d09 ,;
linresul.d10, linresul.d11, linresul.d12, linresul.d13, linresul.d14, linresul.d15 TO arr01
SELECT lifiltro
DELETE ALL
PACK
APPEND FROM linfingr.txt DELIMITED WITH CHARACTER "-"
replace ALL lifiltro.rep WITH 0
SELECT libackup
DELETE ALL
PACK
SELECT lifiltro
SET ORDER TO lifiltro
COUNT ALL TO vban
GO TOP
DO WHILE! EOF ()
WAIT WINDOW "PLEASE WAIT !!! Separating CONFIGURED LINES from the file into GROUPS and their REPTIMENTS ..." + ALLTRIM (STR (vreg)) "+" from "+ ALLTRIM (STR (vban)) NOWAIT
SCATTER FIELDS lifiltro.d01, lifiltro.d02, lifiltro.d03, lifiltro.d04, lifiltro.d05, lifiltro.d06, lifiltro.d07, lifiltro.d08, lifiltro.d09 ,;
lifiltro.d10, lifiltro.d11, lifiltro.d12, lifiltro.d13, lifiltro.d14, lifiltro.d15 TO arr02
FOR i = 1 TO 15
var1 = arr01
FOR j = 1 TO 15
var2 = arr02 [j]
IF var1 = var2
var3 = var3 + 1
ENDIF
ENDFOR
ENDFOR
IF var3> 0
replace lifiltro.rep WITH var3
ENDIF
var1 = 0
var2 = 0
var3 = 0
IF! EOF ()
SKIP
vreg = vreg + 1
ELSE
EXIT
ENDIF
ENDDO
Notice I have two scatters, both creating two arrays, right?
In this routine, FOR counts between the two arrays, the same quantities, however, one by one element until completing 15 and that in a file with more than 1 million records, is very time consuming.
Question:
There is how to count the elements without using FOR, counting the set for example:
ARRAY01 will have all 15 elements = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
ARRAY02 will have another 15 elements = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 16
Note that FOR would count the 15 elements of each array between them, finding 14 equal between the two.
Can you count the elements of the arrays without using FOR, take the whole array01 and find the equals in array02?
With FOR it gets very slow ...
2a. On the basis that:
ARRAY03 will have all 15 elements = 01 02 03 07 08 10 05 06 09 04 11 12 13 14 15
How to make this array be sorted as follows = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15?