CurCol: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 2: Line 2:
The '''CURCOL''' internal function returns cursor column from the last [[INPUT FIELDS]] or [[RINPUT FIELDS]] [[statement]].
The '''CURCOL''' internal function returns cursor column from the last [[INPUT FIELDS]] or [[RINPUT FIELDS]] [[statement]].


One exception is when the most recent field processed is a [[2D control]]. When FIELDS processing ends and control is returned to the program while the 'current' control is of type LIST or GRID, CURROW and CURCOL are set to the current cell row and column within the 2D control instead of the character position relative to the window.
[[CURROW]] and CURCOL return the row or column (within a window) of the first character position of the control being exited. However, if the control is a LIST or GRID then CURROW and CURCOL identify the cell that was exited relative to the control itself. (OPTION 59 provides the exact position of the mouse click.)


===Comments and Examples===
===Comments and Examples===

Latest revision as of 18:22, 23 September 2014

CURCOL

The CURCOL internal function returns cursor column from the last INPUT FIELDS or RINPUT FIELDS statement.

CURROW and CURCOL return the row or column (within a window) of the first character position of the control being exited. However, if the control is a LIST or GRID then CURROW and CURCOL identify the cell that was exited relative to the control itself. (OPTION 59 provides the exact position of the mouse click.)

Comments and Examples

00100 DIM ALL$*1920
00110 INPUT FIELDS "1,1,c 1920,u": ALL$
00120 PRINT "Cursor ended on ROW"; CURROW
00130 PRINT "Cursor ended on COLUMN"; CURCOL
00140 PRINT "Cursor ended on FIELD"; CURFLD

In the sample program above, the entire screen is treated as one 1920-character input field. The operator can move the cursor to any of the 24 rows or any of the 80 columns. After the operator hits the <ENTER> key, line 120 will print the row number containing the cursor when input was ended. Also, line 130 will print the column number. Line 140 will print field 1 because there is only one large field in this example.

Related Functions