Cavin,
If something changes and you want to end the loop before it otherwise would, use the
EXIT command.
for m.lnCounter = 1 to 20
? m.lnCounter
if rand() < 0.05
EXIT
endif
endfor
In this example, the loop has a 5% chance of exiting prematurely for each of the 20 passes through the loop. (A 62% chance of exiting before processing 20 times)
Cheers,
Andrew
>Dear all:
> In "For loop" how can control when the var change is stop the looping ??
> Thx !!
If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?
From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."
All my FoxTalk and other articles are available on my
web site.
Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.