SysError - Display an unrecoverable error message and terminate the program

Top  Previous  Next

Syntax

 

SysError( <cErrorMessage> )

 

Parameters

 

<cErrorMessage>

 

Error message to display before program terminates.

 

Return value

 

SysError never returns.

 

Description

 

SysError is called when a fatal and unrecoverable error occurs in the Cockpit Core. The message passed in <cErrorMessage> is displayed in a MessageBox() and after user acknowledgement the program terminates. This function may be called from outside the Core.

 

Classification

 

Core

 

Category

 

Error Handling

 

Quick Info

 

Library: cckptcor.lib / cckptcor.dll

 

Example

 

 

#INCLUDE "CockpitCoreLibs.ch"

 

FUNCTION Main

 

LOCAL handle

 

* Try to open a file that does not exist

handle := FOpen("DefinitelyNotThere")

 

* Problems encountered?

IF handle == -1

 

  * Display the error and terminate the program

  SysError("Dang: "+WindowsErrorText())

 

ENDIF

 

RETURN NIL