Description

Sets or clears error information.

Syntax

status = Set_Status (error_flag, status_code, status_arguments)

Parameters

The Set_Status function has the following parameters.

ParameterDescription
error_flag

The termination status of the stored procedure. Valid error_flags are:

CodeDescription
-1Append status_code and status_arguments to the existing list. Do not change error_flag.
0Procedure terminated normally (clears the status).
1Procedure terminated abnormally.
status_codeAn alphanumeric error code that identifies the nature of an error. Delimit multiple codes using @FM.

The errors are stored in the DOS file REVERROR.DAT and may contain replaceable parameters. If the code passed in this argument does not exist in REVERROR.DAT, the characters passed in the code argument become the text for the error.

status_argumentsA dynamic array of arguments used for replaceable parameters supplied in the status_code argument. Delimit multiple arguments using valuemarks (@VM).

Note: You can use Set_Status() with Get_Status() to determine if a system routine failed. Before calling the routine, Set_Status(0) to clear any previous status.

See also

Get_Status()Set_FSError()RevError.DatFsMsg routine

Remarks

/* The following code is roughly equivalent to the processing in the Set_FSError function. */
Equ SETSTAT_OK$  To 0
Equ SETSTAT_ERR$  To 1
Equ SETSTAT_APPEND$  To -1
If @FILE.ERROR Then
  code = @FILE.ERROR<FSCODE$>
  If Num(code) Then
    code = FSERROR_PREFIX$:code
  End
End
status = Set_Status(SETSTAT_ERR$, code, @FILE.ERROR<FSMSG$>)
  • No labels