File.Create |
Top Previous Next |
Syntax function File.Create(Filename: string; Encoding: integer): pointer
Description Create a new file with the given Filename making it ready for reading and writing. If a file with the given name exists, this file is overwritten.
The Encoding parameter is one of the following:
The Return value is a file-stream pointer that can be used for additional calls. If file creation fails, NULL is returned.
After successful file creation, the "encoding preamble" is written to the file.
See also
Example execute udsblock as begin /* create a text file with UTF8 encoding */ fs = File.Create('c:\data\utf8text.txt', __encUTF8); try /* write line of text */ File.WriteLn(fs, 'this is a line of text'); finally File.Close(fs); end end |