[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Rewrite Opens a File for Output
Rewrite(var F : <file type>);
Rewrite(var UFile : file; RecSize : Integer); [TP]
Opens the given file for output, setting the file pointer at the first
record in the file. Any previously existing file with the same name is
erased. The file must have been previously assigned to a file or
logical device (using Assign). When used with untyped files, this
procedure can take an optional parameter that specifies the record
size in bytes (the default is 128 bytes).
F Any file type (text, data, untyped).
UFile An untyped file.
RecSize Size of the record in bytes.
-------------------------------- Example ---------------------------------
Assign(TFile,'MYFILE.TXT'); { assign text file }
Rewrite(TFile); { and open for output }
Assign(UFile,'RAWSTUFF.BIN'); { assign untyped file }
Rewrite(UFile,512); { set record size to 512 bytes }
See Also:
Assign
Reset
Append
Close
Write
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson