Siebel VB Language Reference > VB Language Reference >
Tab Function
This standard VB function moves the current print position to the column specified. Syntax
Tab(position)
|
|
position |
The position at which printing is to occur |
Returns
Not applicable Usage
The Tab function can be used only inside a Print statement. The leftmost print position is position number 1. When the Print statement is used, the Tab function uses the following rules for determining the next print position:
- If position is less than the total line width, the new print position is position.
- If position is greater than the total line width, the new print position is n Mod width.
- If the current print position is greater than position or position Mod width, Tab skips to the next line and sets the print position to position or position Mod width.
To set the width of a print line, use the Width statement. Example
This example prints the octal values for the numbers from 1 to 25. It uses Tab to put five character spaces between the values. Sub Button_Click Dim x As Integer Dim y As String For x = 1 to 25 y = Oct$(x) Print x Tab(10) y Next x End Sub
Related Topics
Print Statement Space Function Spc Function Width Statement
|