You can't really do that. The issue is that there are a exception handlers along the way that capture exception so you can't just jump back outside of the call stack.You COULD potentially jump back to your own process method however (since there's no execption handler code there) using RETURN TO, but not to RouteRequest.
However, the proper way to do this is that your called methods (that know about Response etc.) should always return a true or false and if they are called and return false they should return without continuing.
As it is when you call REsponse.End() no more output will be generated into the Response object so even if code runs on no more output gets created. This is not ideal, but unless you return from the process method the code doesn't stop.
+++ Rick ---
Hi Rick,
I'm try to fix some legacy code and the code has been so nested that I want to just post a response message and exit to top level bypassing continuation similar to exception handling, but in this case, it is application exit handling.
What can I call in the process method that will quickly handle sending my response object and end?
subclass of wwprocess --> calls myprog1 --> calls myprog2 --> calls myprog3 ---> "ooops, I want to send out a response and exit out here! what do I call?
Thanks,
Joy
Don't use RETURN TO ROUTEREQUEST - there are lots of issues with RETURN TO in VFP including call stack corruption and issues with the exception handling in Web Connection.
You should just return from the PROCESS method and be done with it. Why do you need to do this - there should never be a reason for this.
+++ Rick ---
Hi Rick,
I have some code that I need to just exit quickly to WC and complete request regardless of the program stack but the page does not get my response:
Response.Clear()
Response.Write("We're done here!")
Response.End()
RETURN TO RouteRequest
WC returns to the read event, but the webpage does not get the response.
What am I doing wrong?
Thanks,
Joy
from Maui, Hawaii