Initialises a lookup table of keys to values. This makes it possible to feed transcription tables into the engine, for example to transform codes into labels. The variable list stops at the first empty line. The first space after the first “:” is omitted in the value.
SET MAPPING <mapname> HAVING key1: value 1 key2: value 2
SET MAPPING codevilles HAVING BEZI: Béziers CARC: Carcassonne NARB: Narbonne PERP: Perpignan SETE: Sète
The created variable is installed in the global context of the execution stack for the lifetime of the script, until it is overridden by another assignment.
Using mapped variables is an extension of the moodlescript “variables” syntax. To access a mapped value, use the syntax:
:mapname[keyname]
Example:
:codevilles[BEZI]