User Tools

Site Tools


throw_signal_an_exception_.htm
Navigation:  Clarion.Net (Clarion#) > Clarion# Language Extensions > Exception Handling >====== THROW (signal an exception) ====== Previous pageReturn to chapter overviewNext page

NewCNet.jpg

THROW expression

THROW Generate a user-defined exception
expression Any valid Clarion expression

blk2blue.jpg

THROW is used to signal any abnormal condition in a Clarion# program. It is user defined, and is used to send any message to the .NET Common Language Runtime (CLR) exception handler.

Examples:

CheckErr    PROCEDURE

CODE

 IF(ERRORCODE()<;>0)

  THROW NEW DataException('ERROR: ' &amp; ERROR())

 END

CheckProdID    PROCEDURE

CODE

 IF(SELF.ProdID > 999999)

  THROW NEW MyException('The value for the product ID was too big')

 END

See also: Exception handling , TRY-CATCH-FINALLY

throw_signal_an_exception_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1