Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Aborting a routine
Message
De
01/02/2017 01:41:31
 
 
À
31/01/2017 23:46:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
SAMBA Server
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01647222
Message ID:
01647240
Vues:
49
BTW, if you periodically call DO EVENTS in the loop, that also allows you to use a button on the form to signal the stopping of the process too (i.e. the Click() event would set the variable that's checked). Depending on how long the particulars of what you're doing in the loop, there may be cases where you may not always want to execute DO EVENTS for every loop iteration (the DO EVENTS does introduce a bit of a delay within the loop -- though it would impact the responsiveness of the control to stop the loop).

>Hi Borislav,
>
>Will try this out. Get back to you asap. Thanks.
>
>>>Hi All,
>>>
>>>Is it possible to 'abort' some processing loop? I tried the code below (form method) to no avail:
>>>
>>>
>>>
>>>ON ESCAPE ThisForm.QuitProcess = .T.
>>>
>>>ThisForm.QuitProcess = .F.
>>>
>>>BEGIN TRANSACTION
>>>
>>>DO WHILE NOT ThisForm.QuitProcess 
>>>     * here, we do stuff like calculations, record inserts
>>>ENDDO
>>>
>>>IF ThisForm.QuitProcess
>>>    ROLLBACK
>>>ELSE
>>>    COMMIT
>>>ENDIF
>>>
>>>
>>>Thanks in advance!
>>
>>Put DO EVENTS somewhere in the loop.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform