FileSystem.TAB 方法

定義

配合 PrintPrintLine 函式用於定位輸出。

多載

TAB()

配合 PrintPrintLine 函式用於定位輸出。

TAB(Int16)

配合 PrintPrintLine 函式用於定位輸出。

TAB()

來源:
FileSystem.vb
來源:
FileSystem.vb
來源:
FileSystem.vb

配合 PrintPrintLine 函式用於定位輸出。

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

傳回

配合 PrintPrintLine 函式用於定位輸出。

範例

此範例會使用 函 TAB 式,將輸出放在檔案和 [ 輸出 ] 視窗中。

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)

備註

如果目前行上的目前列印位置大於 ColumnTAB 則會跳至等於 Column 下一個輸出行的數據行值。 如果 Column 小於 1, TAB 請將列印位置移至第 1 欄。 如果 Column 大於輸出行寬度, TAB 請使用公式計算下一個列印位置:

數據行強制回應寬度

例如,如果 寬度 為 80 且您指定 TAB(90),則下一個列印會從第 10 欄開始, (其餘部分為 90/80) 。 如果 Column 小於目前的列印位置,列印會從計算列印位置的下一行開始。 如果導出的列印位置大於目前的列印位置,列印會從同一行的導出列印位置開始。

輸出行最左邊的列印位置一律為 1。 當您使用 PrintPrintLine 函式列印至檔案時,最右邊的列印位置是輸出檔案的目前寬度,您可以使用 函式進行設定 FileWidth

函式也可以與函 TAB 式搭配 WriteLine 使用。 它不能與 或Console.WriteLine搭配Debug.WriteLine使用。

注意

請確定表格式數據行夠寬,足以包含寬字母。

另請參閱

適用於

TAB(Int16)

來源:
FileSystem.vb
來源:
FileSystem.vb
來源:
FileSystem.vb

配合 PrintPrintLine 函式用於定位輸出。

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

參數

Column
Int16

選擇性。 在顯示或列印清單中的下一個運算式之前所要移至的欄位編號。 如果省略,則 TAB 會將插入點移到下一個列印區 (Print Zone) 的開頭。

傳回

配合 PrintPrintLine 函式用於定位輸出。

範例

此範例會使用 函 TAB 式,將輸出放在檔案和 [ 輸出 ] 視窗中。

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)

備註

如果目前行上的目前列印位置大於 ColumnTAB 則會跳至等於 Column 下一個輸出行的數據行值。 如果 Column 小於 1, TAB 請將列印位置移至第 1 欄。 如果 Column 大於輸出行寬度, TAB 請使用公式計算下一個列印位置:

數據行強制回應寬度

例如,如果 寬度 為 80 且您指定 TAB(90),則下一個列印會從第 10 欄開始, (其餘部分為 90/80) 。 如果 Column 小於目前的列印位置,列印會從計算列印位置的下一行開始。 如果計算的列印位置大於目前的列印位置,列印會從同一行的匯出列印位置開始。

輸出行最左邊的列印位置一律為 1。 當您使用 PrintPrintLine 函式列印至檔案時,最右邊的列印位置是輸出檔案的目前寬度,您可以使用 函式進行設定 FileWidth

函式也可以與函 TAB 式搭配 WriteLine 使用。 它不能與 或Console.WriteLine搭配Debug.WriteLine使用。

注意

請確定表格式數據行夠寬,足以包含寬字母。

另請參閱

適用於