WR SET TAB

4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next

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. You can either use the value or the constant.

ValueConstantText alignment
-1-No change
1 wr left tabLeft alignment
2wr centered tabCentered
3wr right tabRight alignment
4wr decimal tabDecimal
5wr vertical separator tabVertical separator

Note: The list of text properties and their values are available in the "WR Tabs" constants theme. You can pass either the constant name or its value.

fillCharacter can be any character whose ASCII 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.


4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next