In VFP you cannot use RETURN in a TRY/ENDTRY because it's not allowed there. See
Structured Error Handling topic in the help for a list of commands than can/cannot be used in TRY/CATCH/FINALLY blocks.
Why it's not allowed is different question. Definitely it's not because of FINALLY block. Nothing would prevent VFP from executing FINALLY block before RETURN.
>I am fairly new to TRY/CATCH, since I just started using VFP 9 fairly recently, for some clients.
>
>Now, my question is, why can't I do a RETURN from within the CATCH clause? I already found a workaround, just set a variable and then conditionally exit. But I was wondering about the reason - just hoping to get a more profound understanding of the relevant aspects. So, why would VFP not allow the RETURN directly from the CATCH clause?
>
>(Now that I am asking this, I am starting to think it might be related with the need to
inconditionally execute the FINALLY clause - which I don't happen to have in this particular case. Can somebody confirm this?)
--sb--