This is an old revision of the document!
⇐ Index
4rpl supports special syntax for referencing vectors, lists, and tables.
Vectors contain up to 4 fields. These fields can be referenced with .x,.y,.z,.w, .0,.1,.2,.3, or .r,.g,.b,.a. Simply place the '.x' after the variable name for reading or writing.
V4(1 2 3 4) ->vector traceallsp(<-vector.x <-vector.y) 42 ->vector.2 V3(255 0 0) ->red
Lists are collections of data. They are similar to arrays but they do not have a fixed length. They can have items added or removed. The items in a list can be referenced using specific APIS, like GetListElement (and other List APIS). They can also be accessed using bracket notation '[' and ']'.
CreateList ->list "abc" ->list[0] traceallsp(<-list[0])
Tables are collection of named data. They are sometimes called dictionaries in other languages. They contain data made up of some string name and some value. A value can be quickly looked up by its name. Data in a map can be referenced with GetTableElement (and other Table APIs). Data can also be accessed using curly brace syntax '{' and '}'
CreateTable ->table 42 ->table{"SomeName"} traceallsp(<-table{"SomeName"})