version 6.5
WR SET TAB (area; tabNumber; position; alignment; fillCharacter)
Parameter | Type | Description | |
area | Longint | 4D Write area | |
tabNumber | Longint | Tabulation number | |
position | Number | New tabulation position | |
alignment | Integer | New value for the tabulation justification | |
fillCharacter | String | New 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.
Value | Constant | Text alignment |
-1 | - | No change |
1 | wr left tab | Left alignment |
2 | wr centered tab | Centered |
3 | wr right tab | Right alignment |
4 | wr decimal tab | Decimal |
5 | wr vertical separator tab | Vertical 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.