[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|               ON                |
+---------------------------------+
ON(<expC1> [, <expC2>])

-----------------------------------
Returns command assigned to ON ERROR, ON ESCAPE, ON KEY, ON KEY LABEL,
ON PAGE and ON READERROR.
Return value - Character
-----------------------------------

When an event occurs that is trapped by an event handling command, the
command assigned to the event handling command is executed.  ON()
returns the command assigned to an event handling command.  If a command
isn't currently assigned to the event handling command you specify, the
null string is returned.

<expC1>
        <expC1> is used to in specify one of the event handling commands.  Here
are the commands and their corresponding character expressions <expC1>:

Command                         <expC1>
-------                         -------
ON ERROR                        ERROR
ON ESCAPE                       ESCAPE
ON KEY                          KEY
ON KEY LABEL            KEY
ON PAGE                         PAGE
ON READERROR            READERROR

<expC2>
        <expC2> is included to return the command assigned to a specific key or
key combination in ON KEY LABEL.  Include the key label name of the key
or key combination in <expC2>.  A complete listing of key label names is
available in the ON KEY LABEL topic in this help facility.

        Issuing ON KEY LABEL resets ON('KEY') -- ON('KEY') returns the null
string after an ON KEY LABEL command is issued.  Issuing ON KEY resets
ON('KEY', <expC2>) -- ON('KEY', <expC2>) returns the null string after
ON KEY is issued.

+---------------------------------+
|             Examples            |
+---------------------------------+
ON ERROR DO errorhand
ON KEY LABEL CTRL+F2 WAIT WINDOW 'You pressed F2'
ON KEY LABEL ALT+Z DO organize

? ON('ERROR')

? ON('KEY', 'CTRL+F2')

? ON('KEY', 'ALT+Z')

-----------------------------------

See Also:  INKEY(), LASTKEY(), ON ERROR, ON ESCAPE, ON KEY, ON KEY
LABEL, ON PAGE, ON READERROR, READKEY()

-----------------------------------

See Also: INKEY() LASTKEY() ON ERROR ON ESCAPE ON KEY
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson