Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to return to a specific procedure from a error handl
Message
 
À
18/07/1998 00:24:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00118903
Message ID:
00118918
Vues:
14
>Hi,
> I am calling a program (ie. prg file) from the vent handler of a command button on a form. In the prg file, I have a error handler "HandleError". When Iam in HandleError function, I want to return control to the next statement in the button click event instead of the next statement in .prg file.
>
>Is there any way of doing it? I looked at the syntax of "return". It says I can return to any procedure (in the call stack) or master. When I gave
> return to Form1.cmdBtn.Click
>
> I got syntax error.
>If you know, how to do this, please reply to me.
>
>Thanks


Puri,

You will need to pass the commadn butons object reference to the procedure like this;
* Command Button Click
DO MyProc WITH THIS

* Other code
Then in the procedure you receive the reference in a private parameter;
* MyProc
PARAMETERS poObj

* Set your ON ERROR

* Other code
Now in the error handler code you can;
* ON error procedure

RETURN TO poObj.Click
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform