Command WR GET PARAGRAPHS

4D Write

WR GET PARAGRAPHS

version 6.5


WR GET PARAGRAPHS (area; beginPara; endPara)

ParameterTypeDescription
areaLongint4D Write area
beginParaLongintBeginning of the paragraph to return
endParaLongintEnd of the paragraph to return

Description

The WR GET PARAGRAPHS command returns the position of the first character of the first paragraph of the selection and the position of the carriage return of the last paragraph of the selection, in the 4D Write area referenced by area.

Example

The following example scans the document and retrieves the position of the first and last character for each paragraph.

      `Locating the cursor at the beginning of the area
   WR SET SELECTION (area;0;0)
      `Counting the number of paragraphs in the document
   nbPara:=WR Count(Zone;wr nb paragraphs)
      `Processing paragraphs one by one
   For ($i;1;nbPara)
         `Retrieving the position of the first and last characters 
      WR GET PARAGRAPHS(area;begin;Pos)
         `Relocating after the last processed paragraph
      WR SET SELECTION (area;Pos;Pos)
   End for

See Also

WR Get selected text, WR GET SELECTION, WR Get text.