On()
On, Comet! On, Cupid! On Donder and
Blitzen!
Clement Moore, A Visit From St. Nick, 1823
Usage |
cCurrentHandler = ON( cHandler [, cKeyName ] ) |
Parameter |
Value |
Meaning |
cHandler |
Character |
The second word of the ON command whose current setting should be returned. For example, "ERROR", "KEY". For ON KEY LABEL, use "KEY". |
cKeyName |
Character |
For ON KEY LABEL, the key or key combination whose current setting should be returned. |
There's a trap here because misspelling the value for cHandler can lead you to believe there isn't one in effect. For example, if you write ON("ERR"), you get back the empty string and you may think this means there's no error handler in effect. You need to specify ON("ERROR") to get the error handler. We can see why they did it this way. It's much more forgiving and probably easier to add to in the future if new handlers come along, but it means you need to double-check your use of ON(). |
Example |
* Save then restore the current error handler cHoldError = ON( "ERROR" ) ON ERROR DO MyNewErrorHandler * do some processing * now restore it ON ERROR &cHoldError |
See Also |
On AplAbout, On Error, On Escape, On Key, On Key Label, On MacHelp, On Page, On ReadError, On Shutdown |