Muokkaa

Jaa


FileSystem.TAB Method

Definition

Used with the Print or PrintLine functions to position output.

Overloads

TAB()

Used with the Print or PrintLine functions to position output.

TAB(Int16)

Used with the Print or PrintLine functions to position output.

TAB()

Source:
FileSystem.vb
Source:
FileSystem.vb
Source:
FileSystem.vb

Used with the Print or PrintLine functions to position output.

public:
 static Microsoft::VisualBasic::TabInfo TAB();
public static Microsoft.VisualBasic.TabInfo TAB ();
static member TAB : unit -> Microsoft.VisualBasic.TabInfo
Public Function TAB () As TabInfo

Returns

Used with the Print or PrintLine functions to position output.

Examples

This example uses the TAB function to position output in a file and in the Output window.

FileOpen(1, "TESTFILE", OpenMode.Output) ' Open file for output.
' The second word prints at column 20.
Print(1, "Hello", TAB(20), "World.")
' If the argument is omitted, cursor is moved to the next print zone.
Print(1, "Hello", TAB(), "World")
FileClose(1)

Remarks

If the current print position on the current line is larger than Column, TAB skips to the column value equal to Column on the next output line. If Column is less than 1, TAB moves the print position to column 1. If Column is larger than the output line width, TAB calculates the next print position using the formula:

Column Mod width

For example, if width is 80 and you specify TAB(90), the next print will start at column 10 (the remainder of 90/80). If Column is less than the current print position, printing starts on the next line at the calculated print position. If the calculated print position is larger than the current print position, printing starts at the calculated print position on the same line.

The leftmost print position on an output line is always 1. When you use the Print or PrintLine functions to print to files, the rightmost print position is the current width of the output file, which you can set using the FileWidth function.

The TAB function can also be used with the WriteLine function. It cannot be used with Debug.WriteLine or Console.WriteLine.

Note

Make sure your tabular columns are wide enough to contain wide letters.

See also

Applies to

TAB(Int16)

Source:
FileSystem.vb
Source:
FileSystem.vb
Source:
FileSystem.vb

Used with the Print or PrintLine functions to position output.

public:
 static Microsoft::VisualBasic::TabInfo TAB(short Column);
public static Microsoft.VisualBasic.TabInfo TAB (short Column);
static member TAB : int16 -> Microsoft.VisualBasic.TabInfo
Public Function TAB (Column As Short) As TabInfo

Parameters

Column
Int16

Optional. The column number moved to before displaying or printing the next expression in a list. If omitted, TAB moves the insertion point to the start of the next print zone.

Returns

Used with the Print or PrintLine functions to position output.

Examples

This example uses the TAB function to position output in a file and in the Output window.

FileOpen(1, "TESTFILE", OpenMode.Output) ' Open file for output.
' The second word prints at column 20.
Print(1, "Hello", TAB(20), "World.")
' If the argument is omitted, cursor is moved to the next print zone.
Print(1, "Hello", TAB(), "World")
FileClose(1)

Remarks

If the current print position on the current line is greater than Column, TAB skips to the column value equal to Column on the next output line. If Column is less than 1, TAB moves the print position to column 1. If Column is greater than the output line width, TAB calculates the next print position using the formula:

Column Mod width

For example, if width is 80 and you specify TAB(90), the next print will start at column 10 (the remainder of 90/80). If Column is less than the current print position, printing starts on the next line at the calculated print position. If the calculated print position is greater than the current print position, printing starts at the calculated print position on the same line.

The leftmost print position on an output line is always 1. When you use the Print or PrintLine functions to print to files, the rightmost print position is the current width of the output file, which you can set using the FileWidth function.

The TAB function can also be used with the WriteLine function. It cannot be used with Debug.WriteLine or Console.WriteLine.

Note

Make sure your tabular columns are wide enough to contain wide letters.

See also

Applies to