What it does
Reads a numeric property of the script, as set in the editor.
Syntax
1
Prop(property string) → float2
Prop(property string, default float) → floatParameters
| Name | Type | In forms | Meaning |
|---|---|---|---|
| property | string | all | The property's name. |
| default | float | 2 | The value returned when the property does not exist. |
Every form returns
float
The property as a number: true and false become 1 and 0, text that is not a number gives 0. Returns 0, or default, when the property is missing.
Good to know
- Without
default, a missing property also writes one warning to the console, once per name.
Example · generated
Form 1, the short one
DO Print(Prop("value")) Sync()LOOPForm 2, with every argument
DO Print(Prop("value", 1.0)) Sync()LOOPProp 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.