NET/MASTER Network Control Language (NCL) Programmer's Guide

Defining and Using Action Function Keys
Interaction With Users and Terminals
13–8 106160 Tandem Computers Incorporated
Defining and Using
Action Function Keys
This subsection discusses how to define and use action function keys. An action
function key is a function key defined using the ACT operand of the FK (or PF)
command. An action function key is designed to pass the message next to which the
cursor is positioned in an OCS window to an associated NCL procedure.
Defining an action function key associates an NCL procedure with the key. When the
function key is pressed, the associated NCL procedure begins execution and an exact
copy of the message in the OCS window next to which the cursor is positioned is
placed in the &$PRM. MDO variable, which is mapped by the $MSG map. See
Section 10, “Working With Mapping Services,” for more information on MDO
variables. See Section 11, “Standard and User-Defined Maps,” for more information
on the $MSG map.
Note A message mapped by the $MSG map contains many attributes in addition to the visible text.
When the function key is pressed, any text in the OCS command input line, which you
must type before positioning the cursor next to a message, is passed as parameters to
the NCL procedure and placed in the parameters &1 through &n. The system variable
&SYS.PARMCNT holds the number of parameters created, and the system variable
&SYS.ALLPARMS holds the parameters in a single string. The FOLD, NOFOLD, and
EXTPARSE keywords in the PROCEDURE core statement of the NCL procedure
determine how the parameters are parsed. See Section 6, “Procedures and Functions,”
for more information on these system variables and keywords.
If the cursor is positioned next to a message in an OCS window when the function key
is pressed, the A mode indicator appears to the left of the OCS command input line
prompt (=>) to indicate that the NCL process is executing. Pressing an action function
key more than once results in multiple, outstanding actions, which occur when the
NCL procedures that perform the actions are executed. The A mode indicator
disappears when there are no more outstanding actions. If the cursor is positioned in
the OCS command input line when the function key is pressed, the A mode indicator
does not appear.
A function key can hold two types of definitions and two text values simultaneously.
A function key can be defined as an action function key and hold one text value. The
same function key can be defined as either a conversational, immediate, prefix, or
suffix function key and hold a different text value. Both types of definitions are shown
when you display a list of current function key definitions.
An action function key does not execute its associated NCL procedure if it is pressed
while the cursor is in the OCS command input line. To execute the same NCL
procedure while the cursor is in the OCS command input line, you must also define
the function key as a conversational, immediate, prefix, or suffix function key that
executes the NCL procedure. The following example defines the SF1 function key as
both an action function key and a prefix function key:
FK SF1 ACT,PROC1
FK SF1 PREF,-START PROC1+