Name

Tab Function

Class

Microsoft.VisualBasic.FileSystem

Syntax

Tab[(column)]
column (optional; Short)

A column number to which the insertion point will move before displaying or printing the next expression

Return Value

A TabInfo structure

Description

Moves the text-insertion point to a given column or to the start of the next print zone

Rules at a Glance

  • If the column argument is omitted, the text-insertion point will be moved to the beginning of the next print zone.

  • The value of column determines the behavior of the insertion point:

Value of column

Position of insertion point

Current column > column

Moves one line down to the column column.

column > Output Width

Uses the formula column Mod width. If the result is less than the current insertion point, the insertion point will move down one line; otherwise, the insertion point will remain on the same line.

< 1

Column 1

  • The left hand column is always 1.

  • When expressions are output to files using the Print or PrintLine statement, the width of the output is determined by the Width statement.

  • When output surface is divided into columns, the width of each column is the average width of all characters in the current point size of the current font. This means that the number of columns for tabulation purposes does not necessarily relate to the number of characters that can be printed across the width of the output surface.

Programming Tips and Gotchas

The Tab function without a column argument is useful when outputting data to a file ...

Get VB.NET Language in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.