FileSystem.FileWidth(Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Assigns an output line width to a file opened by using the FileOpen
function.
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)
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.
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
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om