>hello,
>thank you very very much,
>it works very well.
>i want to ask, you used For i think we need Endfor,
>but it works, this is like vb.
> any way thanks again.
>regards.
for ...
...
endfor
and
for ...
...
next
are equivalent.
From the help:
FOR Var = nInitialValue TO nFinalValue [STEP nIncrement]
Commands
[EXIT]
[LOOP]
ENDFOR | NEXT
In a syntax summary such as this one, the vertical line, ENDFOR | NEXT, means that you have to use one of the two. (By the way, the symbols around EXIT, LOOP and STEP mean that those parts of the command are optional.)
Both NEXT and ENDFOR are valid. If you only use VFP, ENDFOR is more logical, since other control structures have comparable endings (do...enddo, scan...endscan, etc.) NEXT is more familiar to people who are accustomed to some other programming languages (especially BASIC, I think).
I didn't do much work in BASIC, but somehow I got accustomed to using ENDFOR instead of NEXT.
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)