OpenFileWrite

Family: File · 4 forms

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) → integer
4
OpenFileWrite(szFile string) → integer

Parameters

NameTypeIn forms
IDinteger1, 2
szFilestringall
appendinteger1, 3

What each form returns

1OpenFileWrite(1, "assets/data.dat", 1)nothing
2OpenFileWrite(1, "assets/data.dat")nothing
3OpenFileWrite("assets/data.dat", 1)integer
4OpenFileWrite("assets/data.dat")integer

Example · generated

Form 1, you choose the id yourself

OpenFileWrite(1, "assets/data.dat", 1)DO  Sync()LOOP

Form 3, the command hands back the id

DO  Print(OpenFileWrite("assets/data.dat", 1))  Sync()LOOP

OpenFileWrite 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.

61 commands in File