SaveJSON

Family: JSON · 2 forms

What it does

SaveJSON writes a value: it saves rather than reads. It takes json (an integer) and filename (a string), and answers an integer. That is the first of 2 forms.

Syntax

1
SaveJSON(json integer, filename string) → integer
2
SaveJSON(json integer, filename string, options integer) → integer

Parameters

NameTypeIn forms
jsonintegerall
filenamestringall
optionsinteger2

Every form returns

integer

Example · generated

Form 1, the short one

DO  Print(SaveJSON(1, "assets/data.json"))  Sync()LOOP

Form 2, with every argument

DO  Print(SaveJSON(1, "assets/data.json", 1))  Sync()LOOP

SaveJSON is called and its answer is printed every frame. 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.

36 commands in JSON