What it does
OpenFileWrite opens Write on a File object. It takes ID (an integer), szFile (a string) and append (an integer), and returns nothing. That is the first of 4 forms.
Syntax
1
OpenFileWrite(ID integer, szFile string, append integer)2
OpenFileWrite(ID integer, szFile string)3
OpenFileWrite(szFile string, append integer) → integer4
OpenFileWrite(szFile string) → integerParameters
| Name | Type | In forms |
|---|---|---|
| ID | integer | 1, 2 |
| szFile | string | all |
| append | integer | 1, 3 |
What each form returns
| 1 | OpenFileWrite(1, "assets/data.dat", 1) | nothing |
| 2 | OpenFileWrite(1, "assets/data.dat") | nothing |
| 3 | OpenFileWrite("assets/data.dat", 1) | integer |
| 4 | OpenFileWrite("assets/data.dat") | integer |
Example · generated
Form 1, you choose the id yourself
OpenFileWrite(1, "assets/data.dat", 1)DO Sync()LOOPForm 3, the command hands back the id
DO Print(OpenFileWrite("assets/data.dat", 1)) Sync()LOOPOpenFileWrite is called with values of the types its signature asks for. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.