Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using `RETURN TO`.. unusual error thrown
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01057523
Message ID:
01057584
Views:
7
An interesting additional tidbit: If I just put this in the class's ERROR method:
  IF nError=2059  && Unhandled Structured Exception
    RETURN
  ENDIF
Then the approach I described works OK. That is, the unwind and return seems to work. Of course, time will only tell if this creates a memory leak or something. I guess what I'm really looking for is the functional equivalent of the old "Response.end" statement in ASP, only here for stopping processing within the VFP COM object (i.e., immediate termination of execution, stack unwind, & return to caller). This can come in handy sometimes.

>Mark,
>
>After doing some more thinking about this, I've a couple of more ideas. Now these ideas are just based on how I do things. So you may not agree with what I'm about to write, but that's fine.
>
>First and foremost, I agree that this may be a problem associated with the runtime stack. It's used for a lot of things: parameters, return addresses, loop counters, etc. What I don't know here is where the problem lies. It could be in the VFP compiler or even the compiler that VFP was compiled in. The upshot of this may be that it is something that may not be an easy fix.
>
>One thing that struck me was the word "un-structured". That made me think of structured programming. What people may not realize is that OOP is an extension of the structured programming paradigm. They use the same principles to accomplish the same goals.
>
>In structured programming, one of the rules is that unless there's no other solution, routines have one exit point, and that's the last line of the routine. Further, you don't jump out of loops. The loop ends when the conditions that satisfy the entry no longer do.
>
>I've never found a use that I could justify for using RETURN TO... If I were in your position, I'd refactor the code, starting at the top, so that it wasn't necessary. I know that this may be a lot of work, but I'm very confident that it'll solve the problem.
Previous
Reply
Map
View

Click here to load this message in the networking platform