PUT CURSOR statement
(Character only)Makes the cursor visible on the screen at a specified position.
In data-handling statements such as UPDATE, SET, PROMPT-FOR, and INSERT, the AVM handles cursor display so the user knows where the cursor is located in the window. However, if data is entered through the READKEY statement, and that statement is not part of an EDITING phrase, you might want to turn the cursor on so the user can see the location of the cursor while entering data.
Note: Does not apply to SpeedScript programming.Syntax
OFFROWexpression
The row in which you want to display the cursor. In the ROW option,expression
is a constant, field name, variable name, or expression whose value is an integer that indicates the row where you want to display the cursor. If you do not use the ROW option, PUT CURSOR does not reposition the cursor. Similarly, if you specify a ROW that is outside the screen area, the AVM does not reposition the cursor.COLUMNexpression
The column in which you want to display the cursor. In the COLUMN option,expression
is a constant, field name, variable name, or expression whose value is an integer that indicates the column where you want to display the cursor. If you do not use the COLUMN option, PUT CURSOR does not reposition the cursor. Similarly, if you specify a COLUMN that is outside the windows area, the AVM does not repositions the cursor.ExampleThe following procedure uses PUT CURSOR to make the cursor visible in an editor window. When you run the procedure, you see a frame in a window. You can type text into this frame. The procedure reads each key you enter and takes the appropriate action. Then PUT CURSOR places the cursor in the first row and the first column in the editing frame when you first run the procedure. As you type, the cursor continues to be visible. As the procedure passes through the REPEAT loop for each keystroke, it takes action based on each keystroke and moves the cursor as it takes the action.
The procedure stores the information you type in the comments array, one character at a time. When you finish typing, press GO. The procedure displays the array where the AVM stored the typed information.
Notes
- You must use the PUT SCREEN statement to display data when you use the PUT CURSOR statement. You also have to define a variable for the cursor position, and increment it as the AVM reads the keys entered by the user if you want the cursor to move as the user types.
- The PUT CURSOR statement displays the cursor until you use the PUT CURSOR OFF statement to stop the display.
- Because a cursor is always displayed in an EDITING phrase, using the PUT CURSOR statement in an EDITING phrase (or if you have not issued a PUT CURSOR OFF statement before the phrase) might cause errors.
See also
OpenEdge Release 10.2B
|