Node:Reset, Next:resident, Previous:repeat, Up:Reference
(Under construction.)
procedure Reset (var F: any_file; [FileName: String;] [BlockSize: Cardinal]);
Reset
opens an existing file for reading. The file pointer is
positioned at the beginning of the file.
Like Rewrite
, Append
and Extend
do,
Reset
accepts an optional second and third parameter for the
name of the file in the filesystem and, for untyped files, the block
size of the file. (For details, see Rewrite.)
Reset
is defined in ISO 7185 Pascal.
The BlockSize
parameter is a Borland Pascal extension.
The FileName
parameter is a GNU Pascal extension.
program ResetDemo; var Sample: Text; s: String (42); begin Rewrite (Sample); { Open an internal file for writing } WriteLn (Sample, 'Hello, World!'); Reset (Sample); { Open it again for reading } ReadLn (Sample, s); WriteLn (s); Close (Sample) end.