Skip to content

Set

set {variable} [value]

Also searchable as: Set · assign · variable

set gives a variable a value. The value can be an expression, which is worked out first.

Parameter Meaning
variable Any variable a script can write: %x, !x, *x, or a read/write system variable such as #LPC.
value Optional. A value or expression. Without it, the variable becomes empty.
  • One word only. A value is a single word: set %a hello world stores hello. Join words with _, or glue them with commas: set %a hello , #spc , world.
  • abs after the value stores its absolute value: set %a -5 abs stores 5.
  • A lone + or - after a number adds or takes away 1: set %i %i + is the same as set %i %i + 1.
set %a 2
set %b $A ; hexadecimal: 10
set %c ( %a * %b ) + 1 ; 21
set %d %a * ( %b + 1 ) ; 22
set %name Sir , #spc , Robin ; "Sir Robin"
set %empty
set #LPC 100
display ok %c %d %name
halt

See also

Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.