FileSystem.FileWidth(Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為使用 FileOpen 函式開啟的檔案指派輸出線寬。
public:
static void FileWidth(int FileNumber, int RecordWidth);
public static void FileWidth(int FileNumber, int RecordWidth);
static member FileWidth : int * int -> unit
Public Sub FileWidth (FileNumber As Integer, RecordWidth As Integer)
參數
- FileNumber
- Int32
必須的。 任何有效的檔案號碼。
- RecordWidth
- Int32
必須的。 數字表達式範圍為 0 到 255,表示在新行開始前,該行上出現多少字元。 若 RecordWidth 等於0,則線長無上限。
RecordWidth 的預設值為 0。
例外狀況
檔案模式無效。
範例
這個範例使用 FileWidth 了設定檔案輸出線寬的函式。
Dim i As Integer
FileOpen(1, "TESTFILE", OpenMode.Output) ' Open file for output.
FileWidth(1, 5) ' Set output line width to 5.
For i = 0 To 9 ' Loop 10 times.
Print(1, Chr(48 + I)) ' Prints five characters per line.
Next
FileClose(1) ' Close file.