Command WR SET CURSOR POSITION

4D Write

WR SET CURSOR POSITION

version 6.5


WR SET CURSOR POSITION (area; page; column; line; position)

ParameterTypeDescription
areaLongint4D Write area
pageLongintPage number
columnLongintColumn number
lineLongintLine number
positionLongintHorizontal position of the cursor in the line

Description

The WR SET CURSOR POSITION command moves the insertion point to a new position specified by page, column , line and position.

page: The value for page must be between the first and the last page numbers of the document. The page number must take into account the page numbering as it was defined in the preferences dialog.

column: The value for column must be between 1 and the total number of columns.

line: The value for line must be contained between 1 and the total number of lines of the column (or page, if there is only one column).

position: This value must be contained between 1 and the total number characters in the line. To move the insertion point to the first position in the line, set position to 1.

If you want to place the cursor in an area other than the body area, you need to use the WR SET FRAME command before using the WR SET CURSOR POSITION command.

Example

You want to move the insertion point to the beginning of the 10th line of the 4th page:

      `Making sure that we are in the body area of the document  
   If (WR Get frame (Area)#0)
         `Otherwise, moving to the body area
      WR SET FRAME (Area;wr text frame)
   End if 
      `Moving the cursor
   WR SET CURSOR POSITION(Area;10;1;10;1)
      `Scrolling area to display the insertion point
   WR SCROLL TO SELECTION(Area)

See Also

WR GET CURSOR POSITION, WR SET FRAME.