FileSystem.TAB 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
搭配 Print or PrintLine 函式來定位輸出。
多載
| 名稱 | Description |
|---|---|
| TAB() |
搭配 |
| TAB(Int16) |
搭配 |
TAB()
搭配 Print or PrintLine 函式來定位輸出。
public:
static Microsoft::VisualBasic::TabInfo TAB();
public static Microsoft.VisualBasic.TabInfo TAB();
static member TAB : unit -> Microsoft.VisualBasic.TabInfo
Public Function TAB () As TabInfo
傳回
搭配 Print or PrintLine 函式來定位輸出。
範例
此範例使用 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)
備註
如果當前行的列印位置大於 Column, TAB 則跳過到下一 Column 行輸出行的欄位值。 若 Column 小於 1,則 TAB 將列印位置移至第 1 欄。 若 Column 大於輸出線寬, TAB 則使用以下公式計算下一個列印位置:
欄 Mod 寬度
例如,如果 寬 度是 80,且你指定 TAB(90),下一次列印會從第 10 欄開始(90/80 的剩餘部分)。 如果 Column 小於當前列印位置,列印則從計算出的列印位置從下一行開始。 若計算出的列印位置大於當前列印位置,則列印從計算出的列印位置開始,位於同一行上。
輸出線最左邊的列印位置永遠是 1。 當你用 Print or PrintLine 函式列印到檔案時,最右邊的列印位置就是輸出檔案的當前寬度,你可以用這個 FileWidth 函式設定。
該 TAB 函數也可與函 WriteLine 數一起使用。 它不能與 Debug.WriteLine 或 Console.WriteLine一起使用。
備註
確保你的表格欄目寬度足夠,能容納寬字母。
另請參閱
- Print(Int32, Object[])
- PrintLine(Int32, Object[])
- Space(Int32)
- SPC(Int16)
- FileWidth(Int32, Int32)
- Mod 運算子 (Visual Basic)
適用於
TAB(Int16)
搭配 Print or PrintLine 函式來定位輸出。
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
Optional. 欄位編號會移動到 ,然後才顯示或列印下一個表式。 若省略,則將 TAB 插入點移至下一個列印區的起點。
傳回
搭配 Print or PrintLine 函式來定位輸出。
範例
此範例使用 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)
備註
如果當前行的列印位置大於 Column, TAB 則跳至下一行輸出行的欄位值 Column 。 若 Column 小於 1,則 TAB 將列印位置移至第 1 欄。 若 Column 大於輸出線寬, TAB 則使用以下公式計算下一次列印位置:
欄 Mod 寬度
例如,如果 寬 度是 80,且你指定 TAB(90),下一次列印會從第 10 欄開始(90/80 的剩餘部分)。 如果 Column 小於當前列印位置,列印則從計算出的列印位置從下一行開始。 若計算出的列印位置大於當前列印位置,列印則從計算出的列印位置開始,位於同一行。
輸出線最左邊的列印位置永遠是 1。 當你用 Print or PrintLine 函式列印到檔案時,最右邊的列印位置就是輸出檔案的當前寬度,你可以用這個 FileWidth 函式設定。
該 TAB 函數也可與函 WriteLine 數一起使用。 它不能與 Debug.WriteLine 或 Console.WriteLine一起使用。
備註
確保你的表格欄目寬度足夠,能容納寬字母。
另請參閱
- Print(Int32, Object[])
- PrintLine(Int32, Object[])
- Space(Int32)
- SPC(Int16)
- FileWidth(Int32, Int32)
- Mod 運算子 (Visual Basic)