FileSystem.FileWidth(Int32, Int32) Method

Definition

Assigns an output line width to a file opened by using the FileOpen function.

C#
public static void FileWidth(int FileNumber, int RecordWidth);

Parameters

FileNumber
Int32

Required. Any valid file number.

RecordWidth
Int32

Required. Numeric expression in the range 0-255, inclusive, which indicates how many characters appear on a line before a new line is started. If RecordWidth equals 0, there is no limit to the length of a line. The default value for RecordWidth is 0.

Exceptions

File mode is invalid.

Examples

This example uses the FileWidth function to set the output line width for a file.

VB
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.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also