Shell.GetLastError

Top  Previous  Next

Returns the last available error code.

 

Syntax

function Shell.GetLastError(): integer

 

Alternative Names

ibec_GetLastError
ibec_win_GetLastError

 

Description

Returns the last available error code after calling a Windows routine.

 

The Return Value is a Windows error code, 0 if there's no error.

 

See Also

Shell.GetLastErrorMessage
Shell.GetErrorMessage

 

Example

execute UDSBlock 

as

begin
  Shell.GetDiskFreeSpace('fake'); /* this causes an error */

 

  errcode = Shell.GetLastError();

  errmsg = Shell.GetLastErrorMessage();

  errmsg2 = Shell.GetErrorMessage(errcode);

 

  GUI.ShowMessage('Error code: ' || errcode || String.CRLF() || 'Error msg: ' || errmsg || String.CRLF() || 'Error msg for code: ' || errmsg2);

end