I have a problem using the "do while"-command.
In fact, I have a table (magazines.dbf) that consists of 900.000 records, each representing sales figures of a magazine.
There are 800 different magazines in the table.
Each record has a unique (numeric key - magnumber) that serves as a proxy for the name of a magazine (numbers start from 100 through 900).
What I want to do, is to add records from a given magazine to another table (report.dbf), run a foxpro report (retail.prg) and repeat this until the final number of 900 is reached.
I tried this :
cnt=100
do while cnt <= 900
use report
delete all
pack
append from magazines for magnumber = cnt
do retail.prg
cnt = cnt +1
enddo
The report is provided for the records with magnumber=100 but at the line "cnt = cnt+1" I receive the message "variable CNT is not found".
Can you tell me what's wrong ?
In fact, I have a table (magazines.dbf) that consists of 900.000 records, each representing sales figures of a magazine.
There are 800 different magazines in the table.
Each record has a unique (numeric key - magnumber) that serves as a proxy for the name of a magazine (numbers start from 100 through 900).
What I want to do, is to add records from a given magazine to another table (report.dbf), run a foxpro report (retail.prg) and repeat this until the final number of 900 is reached.
I tried this :
cnt=100
do while cnt <= 900
use report
delete all
pack
append from magazines for magnumber = cnt
do retail.prg
cnt = cnt +1
enddo
The report is provided for the records with magnumber=100 but at the line "cnt = cnt+1" I receive the message "variable CNT is not found".
Can you tell me what's wrong ?