GetErrorMsg Function

Action

Retrieves the error message corresponding to an error code.

Include file

Kernel.bdh

Syntax

GetErrorMsg( in  nErrorCode   : number,
             out sErrorMsg    : string optional,
             in  nMaxErrorMsg : number optional): string;

Return value

Corresponding error message

Parameter Description
nErrorCode Error code
sErrorMsg String buffer receiving the corresponding error message (optional)
nMaxErrorMsg Length of the string buffer (optional)

Example

dcltrans
  transaction TMain
  var
    i : number;
    sErrorMsg : string;
  begin
    for i := 0 to 10 do
      write(GetErrorMsg(i)); writeln;
    end;

    for i := 11 to 20 DO
      GetErrorMsg(i, sErrorMsg);
      write(sErrorMsg); writeln;
    end;
  end TMain;

Output

System: 0 - The operation completed successfully.
System: 1 - Incorrect function.
System: 2 - The system cannot find the file specified.
System: 3 - The system cannot find the path specified.
System: 4 - The system cannot open the file.
System: 5 - Access is denied.
...

Sample scripts

WebRegularExpressions01.bdf