Goto: 4C Home | 4C Docs | System PCLs List sys.stack_fkey()

sys.stack_fkey()

Purpose:
sys.stack_fkey() stacks function keys so that the program acts as if the user entered those keys in the same order that they were stacked.
Usage:
ret = sys.stack_fkey(fkey1 [,fkey2 [,..., [fkey16] ] ... ]);
Arguments:

fkey1 - fkey16 - Up to 16 alpha args
Each arg should be a valid name from the sys.spc_char file.
(i.e. "cancel","accept","user1", "user2", etc.)

fkey1 is mandatory and fkey2 through fkey16 are optional.
Returns:
0 - Normal
There are no error returns.
Where Used:
sys.stack_fkey() can be called from anywhere. Of course, it has no affect until input is needed from the user.
Example:
The following could be used by a scrolling program if it wanted to automatically set add mode if there were no records displayed.

if (sys.dr_count() == 0)
    sys.stack_fkey("add");
Description:
sys.stack_fkey() allows a program to stack function keys as input. It is similar to sys.stack_input(), but only valid function key names can be used, and no <CR> is automatically generated by 4C. A stacked function key acts as if the user entered that key. The 4C function key help programs (sys.spchelp and sys.spcshelp) use this feature when you hit the accept key, or any of the displayed keys. This is not really a stack, it is a FirstIn FirstOut list. So successive stack fkey calls are added to the end of the list rather than the head of the list. The arguments passed to sys.stack_fkey() are also processed in the same order. This can be used when you want to try to anticipate a users response and save keystrokes. Calls to sys.stack_fkey() and sys.stack_input() can be intermixed with predictable results.
Bugs/Features/Comments:
There is no error return, a bad key name is just ignored.
See Also:
sys.stack_input()
sys.set_eod()


Back to Top