This topic has not yet been rated - Rate this topic

FileSystem.FileWidth Method

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

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
public static void FileWidth(
	int FileNumber,
	int RecordWidth
)

Parameters

FileNumber
Type: System.Int32

Required. Any valid file number.

RecordWidth
Type: System.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.

ExceptionCondition
IOException

FileNumber does not exist.

IOException

File mode is invalid.

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

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.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.