Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : CURSORFIELD

CURSORFIELD
Returns the name of the field where the cursor is located. (F)
Invocation
field_name = CURSORFIELD(screen)
 
On return, contains the name of the field. Its syntax is C (fixed-length character string) with length 16.
Usage Notes
An empty string is returned if the cursor is not positioned on a field on the specified screen.
Example
This rule fills the example screen with data from the example table, displays it, determines the name of the current field, and prints it to the message log:

 
CURSORFIELD_1;
_ LOCAL FIELD_NAME;
_ ------------------------------------------------------------------------
_ ------------------------------------------------------------+-----------
_ FORALL EMPLOYEE : | 1
_ EMPLOYEE_DATA.* = EMPLOYEE.*; |
_ INSERT EMPLOYEE_DATA('EMPLOYEE_SCR'); |
_ END; |
_ FCNKEY_SPECS.FCNKEYS = FCNKEY_MSG('EMPLOYEE_SCR'); | 2
_ INSERT FCNKEY_SPECS('EMPLOYEE_SCR'); | 3
_ UNTIL EXIT_DISPLAY DISPLAY EMPLOYEE_SCR: | 4
_ CALL PROCESS_FCNKEY('EMPLOYEE_SCR'); |
_ END; |
_ FIELD_NAME = CURSORFIELD('EMPLOYEE_SCR'); | 5
_ CALL MSGLOG( | 6
_ 'THE CURSOR IS POSITIONED ON THE SCREEN FIELD ' || |
_ FIELD_NAME); |
_ ------------------------------------------------------------------------

 
Sample Output 1
Executing this rule displays the following output:

 
Employee Name Employee#
------------- ---------
SMYTHE 80000
ROTERDAM 80002
CHANG 80003
GARZA 80004
TOWNSEND 80014
PASTARINA 80019
CHESSEL 80020
TOWENSEND 80021
NAPIER 80024
CANON 80033

 
On your screen, a single highlighted character identifies the cursor position.
Sample Output 2
After the rule ends, press PF2 to display the following output.

 
------------------------- INFORMATIONAL MESSAGE LOG -------------------
COMMAND ===> SCROLL ===> P
THE CURSOR IS POSITIONED ON THE SCREEN FIELD LNAME

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved