ERROR( ) Function Example

The following example demonstrates a simple error-handling routine that displays a message when an error occurs.

CLEAR
ON ERROR DO errhand WITH ERROR( ), MESSAGE( )

*** The next line generates an error - there is no BRWSE command

BRWSE
ON ERROR
RETURN

*** Error handler ***

PROCEDURE errhand
PARAMETER errnum,message
? Message 
? 'Error number: '+ ALLTRIM(STR(Errnum))
RETURN