===== MoodleScript: SET MAPPING ===== ===== MoodleScript Script Engine ===== === Effect === 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. === Syntax === SET MAPPING HAVING key1: value 1 key2: value 2 ===Exemples=== SET MAPPING codevilles HAVING BEZI: Béziers CARC: Carcassonne NARB: Narbonne PERP: Perpignan SETE: Sète === Specific attributes === * **mapname**: The name of the table to create, without spaces or special characters. === Notes === 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. === Calling mapped values === Using mapped variables is an extension of the moodlescript "variables" syntax. To access a mapped value, use the syntax: :mapname[keyname] Example: :codevilles[BEZI] === Other defaults === None [[:local:moodlescript:languagespecification|Back to the language index]] - [[:local:moodlescript|Back to the component index]]