PropString

Family: Studio · 2 forms

What it does

Reads a text property of the script, as set in the editor.

Syntax

1
PropString(property string) → string
2
PropString(property string, default string) → string

Parameters

NameTypeIn formsMeaning
propertystringallThe property's name.
defaultstring2The value returned when the property does not exist.

Every form returns

string

The property as text. Returns an empty string, 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(PropString("value"))  Sync()LOOP

Form 2, with every argument

DO  Print(PropString("value", "value"))  Sync()LOOP

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

Related commands

133 commands in Studio