Navigation stuff goes here


Command groups: declare

You can use any number of variables but you must declare them before you set or consult their values. Declaring a variable tells PsyScript to reserve space for a variable of a particular name. The names of declared variables start with $var. The next character should be an upper case letter. Subsequence characters can be upper or lower case letters or digits.

It's not necessary (or possible) to 'undeclare' variables, they are automatically removed at the end of the procedure the declare command is in. For more about scope, see about variables.

If you have declared a variable you're probably going to want to use a set command or a read command to set its value.

Commands

declare variablename

Reserve space for a variable of that name until the procedure the declare command is in ends.

declare $varCurrentScore
declare $varX

Technical notes

The $var at the beginning of the variable name is a give-away that it's a user-defined variable, not one with a value PsyScript maintains automatically.

See also