set <variable> to <value>


This sets the specified variable to the value provided.

Setting to a constant

You can specify a constant or an alternative variable by using the following:
set A to 123
set R to 12.34
set B to %1100
set M to A

When assigning a float to an integer, the value is rounded down. You should use roundcast() to round to the nearest value.

Reading from the teletext frame

You can use the syntax char( <x>, <y> ) to provide a byte read from the currently selected teletext frame.
The X value is in the range 1 to 40, and the Y value is in the range 1 to 25. The following returns the second character of the header line (usually a 'P' (ASCII 80)):
set A to char(2, 1)

setchar() is the logical opposite of this.

Setting to a status value

You can use the syntax status( <option> ) to provide information on various miscellaneous items that may be of use.

Note that the status parameters are macros, not strings, therefore they are not quoted. For example:

set A to status(channel)

The available status options are:


Refer to the individual descriptions for information on variations between the RISC OS and Windows interpreters and their respective capabilities.