| 4D Write v15WR GET WORDS | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D Write v15
 WR GET WORDS 
         | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WR GET WORDS ( area ; beginSel ; endSel ; smartCutPaste ) | ||||||||
| Parameter | Type | Description | ||||||
| area | Longint |   | 4D Write area | |||||
| beginSel | Longint |   | Beginning of the word to return | |||||
| endSel | Longint |   | End of the word to return | |||||
| smartCutPaste | Integer |   | 1 if the last character is a space, otherwise 0 | |||||
The WR GET WORDS command returns the position of the first character of the first word of the selection and the position of the last character of the last word of the selection. It also specifies if the last character of  the selection is a space. If no text is selected, beginSel and endSel returns the first and last character of the word the cursor is in.
This command has no effect on the current selection.

If the selection begins in the middle of a word (or between the last character of a word and the next following space), beginSel will return the position of the first character of that word.
If the selection ends in the middle of a word, there are two possible cases:
The following example scans the document and retrieves the position of the first and last characters for each word.
  `Placing the cursor at the beginning of the area
 WR SET SELECTION(area;0;0)
  `Counting the number of words in the document
 nbWords:=WR Count(area;wr nb words)
  `Processing the words one by one
 For($i;1;nbWords)
  `Retrieving the position of the first and last character of the word
    WR GET WORDS(area;beginning;pos)
  `Relocating after the last processed word
    WR SET SELECTION(area;Pos;Pos)
 End for
	Product:  4D Write
	Theme:  WR Text Manipulation
	Number:  
        89465
        
        
        
	
	Created:  4D Write 6.5
	
	
	
	
	
	
	
	
	4D Write Language ( 4D Write v15)
	
	
	
	
	
	
	
 Add a comment
Add a comment