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.
Reset Procedure
◄Summary► ◄Details► ◄Example► ◄Back►
Arguments
file_variable Typed, untyped, or text file; already assigned
size Optional; block size for data transfers; applies
only to untyped files (default is 128 bytes)
Description
The Reset procedure opens an existing file of any type or resets
an open file. The opened file is the disk file or input device
previously associated with file_variable. Use the Assign procedure
to associate an external file name with file_variable. Reset moves
the current position of the opened file to the first position in
the file.
A file can be text, typed, or untyped. Reset operates according to
file type:
Opens a text file for read-only. After Reset, the Eof function
returns True if the file is empty and False otherwise. By
default, Reset associates a 128-byte buffer with a text file.
Use the SetTextBuf procedure to specify a buffer of a
different size.
Opens a typed or untyped file for reading and writing.
Changes the default record size for untyped files. The
BlockRead and BlockWrite procedures transfer data to and from
untyped files in blocks (records) of a specific size. The
FileSize function returns the size of a file in blocks. An
untyped file has a default block size of 128 bytes. The size
argument changes this setting. On many machines the most
efficient size is a multiple of 512 bytes.
Opens a device for input.
To refer to the standard file Input (file handle 0), call Assign
with a null string, then Reset the file.
If file_variable has not been previously assigned to a external
file name or if no external file by the associated name exists,
an I/O error occurs.
To prevent a program from halting with a run-time error when an
I/O error occurs, turn off I/O checking with {$I-} and check the
return value of the IOResult function.