PARAMETERS Command Example

The following example passes parameters to an error-handling routine.

ON ERROR DO errhand WITH ERROR( ), MESSAGE( ), ;
   MESSAGE(1),PROGRAM( ),LINENO( )
USE nodatabase
ON ERROR         && restores system error-handling routine

PROCEDURE errhand
PARAMETERS gnError, gcMess, gnMess1, gcProg, gnLineNo
? 'Error number: ' + LTRIM(STR(gnError))
? 'Error message: ' + gcMess
? 'Line of code with error: ' + gnMess1
? 'Line number of error: '+ LTRIM(STR(gnLineNo))
? 'Program with error: ' + gcProg