User Tools

Site Tools


seterror_save_the_specified_error_and_underlying_error_state_.htm
Navigation:  ABC Library Reference > FileManager > FileManager Methods >====== SetError (save the specified error and underlying error state) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

SetError( error id )

blk2blue.jpg

SetError Saves the specified error and the underlying error state for use by the Throw method, etc.
error id A numeric constant, variable, EQUATE, or expression that identifies the error. See Error Class for more information on error id.

The SetError method saves the specified error and underlying error state for use by the Throw method, etc.

Example:

Access:Client.Next FUNCTION(BYTE HandleError) !Next function

CODE                                        !with alternative error handling

LOOP

 NEXT( SELF.File )                          !get the next record

 CASE ERRORCODE()                           !check for error conditions

 OF BadRecErr OROF NoError

  RETURN Level:Benign

 OF IsHeldErr                               !if record is HELD by another

  SELF.SetError(Msg:RecordHeld)             !make RecordHeld the current error

  IF HandleError                            !if interactive error handling

   RETURN SELF.Throw()                      !pass current error to error handler

  ELSE                                      !otherwise (silent error handling)

   RETURN Level:Notify                      !return error code to caller

  END

 END

END

See Also:     Throw

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