OpenFile()
Syntax
Result = OpenFile(#File, FileName$)Description
It will open the designed file or create it if it doesn't exists. You can perform read and write on this file. OpenFile() will be used the same way like the "read-only" ReadFile() and the "write-only" CreateFile() commands, where you also find code examples.
If #PB_Any is used as '#File' parameter, the new file identifier will be returned as 'Result'.
If 'Result' is not 0, the file is effectively opened, else the file can't be opened. It must be always tested, as performing operations on a non opened file will cause severe crashs.
If the #File was already used, the previous file is automatically closed.
Note: when using OpenFile() the file must have the rights for reading AND writing. Think about this, e.g. if you are using a cdrom. If you only want to read from a file, better use ReadFile() instead.
Supported OS
All