Command WR GET SELECTION

4D Write

WR GET SELECTION

version 6.0


WR GET SELECTION (area; first; last)

ParameterTypeDescription
areaLongint4D Write area
firstLongintReceives first character
lastLongintReceives last character

Description

The WR GET SELECTION command returns, in the first and last variables, the positions of the selected text in Area.

first is always one less than the first character selected. last is always equal to the last character selected. If first and last are equal, no text is selected and the insertion point is positioned after the character described by first.

Example

The following example sets the margins of the whole document and retrieves the original selection:

   WR GET SELECTION(area;StartSel;EndSel)  `Re-reading the current selection
   WR EXECUTE COMMAND(area;wr cmd select all)   `Select all
      `Setting margins
   WR SET TEXT PROPERTY(area;wr left margin;49)
   WR SET TEXT PROPERTY(area;wr first indent;49)
   WR SET TEXT PROPERTY(area;wr right margin;504)
   WR SET SELECTION(area;StartSel;EndSel)  `Resetting the selection

See Also

WR Get selected text, WR Get text, WR SET SELECTION.