Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using `RETURN TO`.. unusual error thrown
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Using `RETURN TO`.. unusual error thrown
Miscellaneous
Thread ID:
01057523
Message ID:
01057523
Views:
51
This is an interesting scenario that I cannot figure out:

I have a COM DLL that has an OLEpublic class with a method that calls an external procedure like this:
procedure myMethod
Do ExternalProc 
Return
EndProc
ExternalProc does a lot of stuff and calls other routines that go several routines deep. At certain points within those routines, there is a need to unwind and exit. So I tried this:
Return to myMethod
Now, this seems to execute OK. But then upon execution of the Return statement within myMethod, I get the following error (which my ERROR routine in the class picks up and reports):
Error No: 2059
Procedure/Method: myMethod
Message: Unhandled Structured Exception.

Can somebody tell me why this is happening? If this is stupid way of accomplishing what I'm after (i.e., unwinding the VFP procedure stack and returning immediately to the user of the COM object, which happens to be an ASP page) please let me know the right way to accomplish the same objective. Simply using a bunch of cascading RETURN statements driven by some kind of status checking is pretty inefficient here. I found that using "CANCEL" just causes an error on the ASP page. Thanks very much.
Next
Reply
Map
View

Click here to load this message in the networking platform