DDS for display files


RTNCSRLOC (Return Cursor Location) keyword for display files

Use this record-level keyword to return the location of the cursor to an application program.

This keyword may be specified in two formats. These formats are:

The formats of the keyword is:

RTNCSRLOC([*RECNAME]
&cursor-record &cursor-field
[&cursor-position])
or
RTNCSRLOC({*WINDOW | *MOUSE}
&cursor-row &cursor-column
[&cursor-row2
[&cursor-column2]])

The parameter for the first format are:

All three fields specified on the RTNCSRLOC keyword will contain values on input if the cursor is outside the area of the record that contains the RTNCSRLOC keyword. The fields also contain values on input if the cursor is located in a subfile. The cursor-record field will contain a value if the cursor is located anywhere inside the subfile. The cursor-field and cursor-position fields will contain values if the cursor is located on a field within the subfile.

The parameters for the second format are:

Both formats of this keyword may be specified with the same record. If the same hidden field is used multiple times for any of the parameters, unpredictable results will occur.

Option indicators are not valid for this keyword.

Example:

The following example shows how to specify the RTNCSRLOC keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A          R REC01                     RTNCSRLOC(&RCD &FLD &POS);
     A                                      RTNCSRLOC(*MOUSE &ROW &COL);
     A            FLD           10A  H
     A            RCD           10A  H
     A            POS            4S 0H
     A            FLD1A          2A  I  3  2
     A  10        FLD2A          6A  O  3 18
     A N10        FLD3A         10A  O  3 18
     A*
     A          R REC02                     OVERLAY
     A            FLD1A          2A  I  5  2
     A            FLD2A         10A  O  5  5
     A            FLD3A          6A  O  5 18
     A

Both REC01 and REC02 are displayed on the screen and option indicator 10 is off.

The following table shows the values returned when the cursor is at the specified positions.

Row Col Cursor Record Cursor Field Cursor Position Cursor Row Cursor Column
3 2 REC01 FLD1A 1 3 2
3 19 REC01 FLD3A1 2 3 19
3 25 REC01 FLD3A 8 3 25
3 40 REC01 blanks 0 3 40
4 40 blanks blanks 0 4 40
5 5 REC02 FLD2A 1 5 5
5 40 REC02 blanks 0 5 40
1 If Option indicator 10 were on, FLD2A would be returned when the cursor is at row 3 column 19.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]