4D Write v16

WR Get text property

Home

 
4D Write v16
WR Get text property

WR Get text property 


 

WR Get text property ( area ; property ; sameProperty ) -> Function result 
Parameter Type   Description
area  Longint in 4D Write area
property  Integer in Property number
sameProperty  Integer in 1 if the whole selection has that property, 0 if part or all of the selection does not have the property
Function result  Real in Depends on the property

The WR Get text property command allows you to determine whether the property passed in property is used in the current selection of the 4D Write area referenced by area.

  • If sameProperty is equal to 1, the property is applied to the whole selection.
  • If sameProperty is equal to 0, the property is not applied to the whole selection.
    The returned value then corresponds to the status of the last character of the selection.

The property parameter lets you set the property to be examined. For more information, refer to the description of the WR SET TEXT PROPERTY command.

If you pass an invalid property number, the error 1075 is returned.

You want to make sure that margin sizes do not exceed a fixed value:

 LEFT:=WR Get text property(Area;wr left margin;$Uniform)
 If(LEFT<3) `Setting the left margin to 3
    WR SET TEXT PROPERTY(Area;wr left margin;3)
 End if
 RIGHT:=WR Get text property(Area;wr right margin;$Uniform)
 If(RIGHT>43) `Setting the right margin to 43
    WR SET TEXT PROPERTY(Area;wr right margin;43)
 End if

You want users to be able to set the line spacing and alignment, but you do not want them to have access to menus and rulers. The input form contains a button labeled Info and two variables, LineSpacing and Alignment, each of them attached to a method.

- The following is the object method for the Info button, it retrieves information about the current cursor position:

 LineSpacing:=WR Get text property(Area;wr line spacing;$Uniform)
 If($Uniform=0)
    ALERT("The selection contains several types of line spacings.")
    $Assign:=True
 Else
    $Assign:=False
 End if
 Alignment:=WR Get text property(Area;wr justification;$Uniform)
 If($Uniform=0)
    ALERT("The selection contains several types of alignments.")
 End if

- LineSpacing object method sets the user's choice for line spacing:

 WR SET TEXT PROPERTY(Area;LineSpacing)

- Alignment object method sets the user's choice for alignment:

 WR SET TEXT PROPERTY(Area;Alignment)

- In the On load form event, you hide menus and rulers:

 If(Form event=On Load)
    WR SET DOC PROPERTY(Area;wr view menubar;0)
    WR SET DOC PROPERTY(Area;wr view rulers;0)
 End if



See also 

WR SET TEXT PROPERTY

 
PROPERTIES 

Product: 4D Write
Theme: WR Text Manipulation
Number: 89442

 
HISTORY 

Modified: 4D Write 2003

 
ARTICLE USAGE

4D Write Language ( 4D Write v16)