if there is any error during the try part your code will jump directly 
to the catch.  from the catch you can throw an error to a higher error 
routine.  that is my understanding.  this is the example out of the help 
  files.

TRY

      [ tryCommands ]

[ CATCH [ TO VarName ] [ WHEN lExpression ]

      [ catchCommands ] ]

[ THROW [ eUserExpression ] ]

[ EXIT ]

[ FINALLY

      [ finallyCommands ] ]

ENDTRY

in the explination of the try catch the help file said this about the 
throw: THROW [ eUserExpression ] ]
Creates a new Exception object to be caught by a CATCH statement. You 
can call THROW from any code block in a TRY...CATCH...FINALLY structure. 
However, you can use THROW anywhere in code where an error handler 
exists to catch the exception. You cannot call THROW from the Command 
window.

My question is to you have a higher try catch to, sorry for the pun, 
catch the throw???

John Weller wrote:
> I'm using Craig Boyd's excellent code to send email using EsSmtp (thank you
> Craig).  It is very clear but there is one area that confuses me slightly
> concerning the THROW command.
> 
> The code is as follows (much abbreviated):
> 
> TRY
>       Set up parameters
>       Call Send Mail method
>       If Send Mail returns an error
>               do case
>                       case errorno = nnn
>                               THROW 'Some Error Message'
>                       case etc
>               endcase
>       endif
> 
> CATCH TO loError
>       lcReturn = [Error: ] + STR(loError.ERRORNO) etc
> 
> FINALLY
>       Release object
> 
> ENDTRY
> 
> RETURN lcReturn
> 
>>From what I can see if there is an error in the TRY block the method will
> return a string giving details of the error but I can't see where the
> messages  generated by the THROW command will be displayed, if at all.  As I
> understand it if the code executes perfectly but the mail is not sent,
> perhaps because the mailbox is busy, there will not be any indication.  From
> my reading of 'What's New in VFP8' an Exception object will be created.
> Should I be testing for this object?  If so, how?
> 
> TIA
> 
> John Weller
> 01380 723235
> 07976 393631
> 
> 
> 
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to