Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return to a specific procedure from a error handl
Message
 
To
18/07/1998 00:24:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00118903
Message ID:
00118918
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform