![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS Component Language: Reference |
class myHalt extends
sashelp.classes.programHalt.class;
_onGeneric:method / (STATE='O');
dcl list msgs=makelist();
rc = insertc(msgs, "SCL program failed at ", 1);
rc = insertc(msgs, "Entry=" || entry, 2);
rc = insertc(msgs, "Line=" || putn(lineNumber, "3.0"), 3);
if (keywordType = 'function') then
rc = insertc(msgs, "Function=" || keyword, 4);
else
rc = insertc(msgs, "Method=" || keyword, 4);
/* At this point, you may want to */
/* call the TRACEBACK routine and dump */
/* attributes from the class (using */
/* the _getAttributes method). */
rc = messageBox(msgs);
/* continue execution */
stopExecution = 'No';
endmethod;
endclass;
Note:
Entry, lineNumber,
and keyword are all object
attributes that are defined in the class sashelp.classes.programHalt.class. ![[cautend]](../common/images/cautend.gif)
The programHalt handler must be declared at the beginning of your application. For example:
dcl myHalt obj = _new_ myHalt();
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.