Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: Syntax
Divers
Thread ID:
00364024
Message ID:
00364036
Vues:
33
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
  * do the processing here - e.g.
  ? m.lnCounter

  * check for the exit condition - e.g.
  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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform