PickBASIC / FlashBASIC
%fopen() function
.mdThe %fopen() function opens the host OS file designated by str and associates a stream with it.
Syntax
Parameter(s)
| str | Specifies the file to open. | |
| type | Character string having one of these values: | |
| r | Opens for reading only. | |
| r+ | Opens for update. | |
| w | Truncates or creates for writing only. | |
| w+ | Truncates or creates for update. | |
| a | Append. Opens for writing at the end of file or creates for writing. | |
| a+ | Append. Opens for writing at the end of file or creates for update. | |
Description
The stream is returned as a pointer to a character or 0 if an error occurred. system(0) contains the error number.
Note: In D3, files are closed automatically
when the FlashBASIC programs terminate. However, it is strongly recommended
that you close all descriptors explicitly.