What it does
Reads an integer property of the script, as set in the editor.
Syntax
1
PropInteger(property string) → integer2
PropInteger(property string, default integer) → integerParameters
| Name | Type | In forms | Meaning |
|---|---|---|---|
| property | string | all | The property's name. |
| default | integer | 2 | The value returned when the property does not exist. |
Every form returns
integer
The property as an integer, with any fraction dropped. 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(PropInteger("value")) Sync()LOOPForm 2, with every argument
DO Print(PropInteger("value", 1)) Sync()LOOPPropInteger 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.