Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Aborting a routine
Message
De
31/01/2017 23:48:20
 
 
À
31/01/2017 04:06:44
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
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:
01647238
Vues:
45
Hi Al,

Thanks for your reply.

Yes, ESCAPE is set to ON. No code in the form's KeyPress event as well.

Will also tinker with your suggestions - use a variable instead of a form property.

Get back to you asap.

Are you still developing VFP apps may I ask?



>>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!
>
>Might be too obvious, but SET ESCAPE must be set to ON.
>
>Another thing to be wary of is, I don't know if ThisForm is still in scope during processing of an ON ESCAPE handler. To check you could reference the actual name of the form i.e.
>
>ON ESCAPE ActualNameOfForm.QuitProcess = .T.
>
>or, you could set and use a PRIVATE or PUBLIC memvar rather than a form property (if only for debugging purposes).
>
>Another thing you might need to check is if you've defined any code in the Form.KeyPress() or elsewhere that may get called.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform