Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
SetTextBuf Procedure
◄Summary► ◄Details► ◄Example► ◄Back►
Arguments
file_variable Text file; may be open
buffer Any variable, usually an array of characters
or bytes
size Optional; integer expression representing a number
of bytes (default is size of buffer)
Description
The SetTextBuf procedure reassigns the input-output buffer for a
text file from the default internal buffer to a specified buffer
variable. A larger buffer can speed up programs that perform
intensive I/O on a a text file.
If a buffer size is specified, subsequent I/O operations use a
region of that size in the buffer. If no size is specified, the
entire buffer is used. The following calls are equivalent:
SetTextBuf( file_variable, buffer );
or
SetTextBuf( file_variable, buffer, SizeOf( buffer ) );
The buffer remains assigned to file_variable until the Assign
procedure associates a new file with file_variable.
Call SetTextBuf before or immediately after the Reset, Rewrite, or
Append procedures. Do not call SetTextBuf on open files after
reading or writing since data may be lost.
Do not use a local variable as a buffer for a file that will
remain open past the end of a procedure, because the buffer will
not exist once the procedure exits.