Command WR SET TAB

4D Write

WR SET TAB

version 6.5


WR SET TAB (area; tabNumber; position; alignment; fillCharacter)

ParameterTypeDescription
areaLongint4D Write area
tabNumberLongintTabulation number
positionNumberNew tabulation position
alignmentIntegerNew value for the tabulation justification
fillCharacterStringNew character selected as fill character

Description

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. Pour ne pas modifier la justification de la tabulation, passez -1 dans ce paramètre. Sinon, vous pouvez utiliser les constantes suivantes, placées dans le thème "WR Tabulations" :

Constant (Value)Text alignment
wr left tab (1)Left aligned
wr centered tab(2)Centered
wr right tab (3)Right aligned
wr decimal tab (4)Decimal
wr vertical separator tab (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;350;$Justif;"$")
            $i:=$i+1
      End case 
   Until ($i=$Nbtab)
      `Going back to original unit
   WR SET DOC PROPERTY (Area;wr unit;$Unit)

See Also

WR GET TAB, WR SET STYLESHEET TAB.