>hello,
>
>thank you for yor reply,
>
>realy i don't know, how i can do many things you advice me
>to do at my code ,
>if you use my code to show me how i can make my program better than know,
>
>thank you .
>
>regards
Really, the main idea here was to use SCAN, so you can:
Replace the DO WHILE... at the beginning, with a SCAN.
Replace the ENDDO at the end, with an ENDSCAN.
Eliminate the SKIP, since this is implicit in a SCAN.
Eliminate the GO TOP, since that is also implicit in a SCAN.
Kli>Finally, as William Sanders pointed out, the filter is not necessary; it is easier to put a FOR in the SCAN.
With all these changes, your code will look like this. I am commenting, with triple asterisks, the lines I eliminate. I am also putting a comment at the end of lines I added: && Added by Hilmarselect 1
m.no=no
month1=month1
m.year1=year1
m.dd= month(date())
m.ff=year(date())
SCAN FOR month1=m.dd .and. year1=m.ff
thisform.text3.value=dat
thisform.text1.value=total
thisform.text6.value=month1
thisform.text32.value=year1
thisform.text2.value=amount1
select 4
append blank
replace no with m.no
replace m1 with thisform.text6.value
replace amount1 with thisform.text2.value
replace year1 with thisform.text32.value
select 1
m.no=no
ENDSCAN
select 4
report form tab3 preview
zap
For the cursor, see CREATE CURSOR in the help.
Also see my other suggestions in my other message - you don't need to implemente them all at once! But in the case of SCAN, there are several related parts.
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)