Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrapping up messages in XML
Message
 
To
22/03/2004 09:26:37
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00888363
Message ID:
00888659
Views:
15
OK, thanks.

I do however want to end up being able to process vis the CATCH of the current procedure, because there may be a standard number of things I need to do to clean up. Is the following how should I construct the THROW in this scenario? (It works OK for me)...
TRY
  lc_message = "a message to say everthing's good"
  
  IF .t. && fake an error
    *-- This is the bit I need help with - how do I get the error handler
    *-- below (i.e. the CATCH) to get this message as an error - since its
    *-- not a genuine error - I just want to use CATCH to handle all problems
    *-- Is this correct
    lc_message = "Huston, we have a problem"
    THROW lc_message
   
  ENDIF

  CATCH to lo_Exception
    lc_errormsg = 'Error: '+TRANSFORM(lo_Exception.Errorno) + ;
                  ' - ' + lo_Exception.Message +;
                  CHR(13) + CHR(10) + ;
                  'Line #: ' + TRANSFORM(lo_Exception.lineno) + ;
                  ' - ' + lo_Exception.linecontents + ;
                  CHR(13) + CHR(10) + ;
                  'Function: '+ TRIM(lo_Exception.procedure)

    lc_messge = lc_errormsg    
  FINALLY 
ENDTRY

lc_XML = '<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>' + ;
         CHR(13) + CHR(10) + ;
         '<text>' + ;
         CHR(13) + CHR(10) + ;
         lc_messge + ;
         CHR(13) + CHR(10) + ;
         '</text>'
 
RETURN lc_XML
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform