SQL iQuery Script Built-in Functions

Return True when a Specific Function Key is Used

FKEY, FnKey, cmdKey

The FKEY() built-in function checks for a Function Key being used to return control from an EXFMT iQuery Script command. Any function key can be specified.

Syntax

The FKEY built-in function checks for the specified function key. If it was used to return control from an EXFMT command, then it is true. Use this to control the logic flow of your iQuery Scripts when using Prompting.

Parameters

  1. The symbolic name of any of the Function key 1 to 24 (e.g., F1, F2, F3, F12, etc.) as well as ENTER. Upper/lower case is ignored.

Example:

#define &custRec = '/home/custrec.html';

dspwin "Print or view your Library List";
dspvar &output,3,2,char(10),values(*PRINT *),"Output queue to use";
exfmt;
if FKey(F3)
return;
endif

cl: dsplibl OUTPUT(&output);

This iQuery script prompts the end-user to enter *PRINT or * to indicate if they want the output from the DSPLIBL command directed to the display or to an output queue. If the User press F3=Exit, then the RETURN command is run and the script terminates. Otherwise, the DSPLIBL command is run with the content of the Session Variable controlling the output option.