FileSystem.FileWidth(Int32, Int32) Metoda

Definicja

Przypisuje szerokość wiersza wyjściowego do pliku otwartego przy użyciu FileOpen funkcji .

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)

Parametry

FileNumber
Int32

To jest wymagane. Dowolny prawidłowy numer pliku.

RecordWidth
Int32

To jest wymagane. Wyrażenie liczbowe w zakresie od 0 do 255 włącznie, które wskazuje liczbę znaków wyświetlanych w wierszu przed rozpoczęciem nowego wiersza. Jeśli RecordWidth równa się 0, nie ma limitu długości wiersza. Wartość domyślna RecordWidth to 0.

Wyjątki

Tryb pliku jest nieprawidłowy.

Przykłady

W tym przykładzie użyto FileWidth funkcji , aby ustawić szerokość wiersza wyjściowego dla pliku.

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.

Dotyczy

Zobacz też