4D v13

WR SET TAB

Home

 
4D Write v13
WR SET TAB

WR SET TAB 


 

WR SET TAB ( area ; tabNumber ; position ; alignment ; fillCharacter ) 
Parameter Type   Description
area  Longint in 4D Write area
tabNumber  Longint in Tabulation number
position  Longint in New tabulation position
alignment  Integer in New value for the tabulation justification
fillCharacter  String in New character selected as fill character

The WR SET TAB command allows you to set the parameters of the tab stop whose number was passed in tabNumber (tabs are counted left to right). The WR SET TAB command will move the tab stop to position and will set the fill character as well as the alignment of the tab stop.

The selected tab stop will be modified for all the paragraphs of the current selection. If a tab stop already exists at the new location it will be replaced by the tab stop you just modified.

position is the distance from the left margin. position is expressed in the current default unit for the document. If you do not want to change the position of the tab stop, pass -1 in the parameter.

alignment specifies the alignment for the tab stop. If you do not want to modify the alignment of the tab, pass -1 in this parameter. Otherwise, you can use the following constants, found in the “WR Tabs” theme:

Constant Type Value Comment
wr left tab Longint 1 Left aligned
wr centered tab Longint 2 Centered
wr right tab Longint 3 Right aligned
wr decimal tab Longint 4 Decimal
wr vertical separator tab Longint 5 Vertical separator

fillCharacter can be any character whose code is contained between 33 and 127. This character is displayed in the same font as the modified tab stop.

Example  

In the selection, you want to delete the tab stops that are located at 168 points, move tab stops from 252 points to 280 points and assign '$' as fill character:

 C_LONGINT(Area;$i;$Nbtab;$Unit;$uniform;$Justif)
 C_REAL($Pos)
 C_STRING(2;$fill)
 $Nbtab:=WR Get text property(Area;wr tab;$uniform)
  `Storing current unit
 $Unit:=WR Get doc property(Area;wr unit)
 If($Unit#2)
  `Setting unit to points if not already set
    WR SET DOC PROPERTY(Area;wr unit;2)
 End if
 $i:=1
 Repeat
    WR GET TAB(Area;$i;$pos;$Justif;$fill)
    Case of
       :($Pos=168)
  `Deleting tab stops located at 168 points
          WR DELETE TAB(Area;$i)
          $Nbtab:=$Nbtab-1
       :($Pos=252)
  `Moving tab stops located at 252 points to 280 points
          WR SET TAB(Area;$i;280;$Justif;"$")
          $i:=$i+1
    End case
 Until($i=$Nbtab)
  `Going back to original unit
 WR SET DOC PROPERTY(Area;wr unit;$Unit)

 
PROPERTIES 

Product: 4D
Theme: WR Tabs
Number: 89478

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Write 6.5

 
SEE ALSO 

WR GET TAB
WR SET STYLESHEET TAB