map
- map(table, key, default=null): String
-
Lookup value from mapping table.
Table 1. Parameters table
Table name or ID.
key
String key to lookup.
default
Optional default value.
ReturnWhen key or table is not found, return
nullor default value if provided.
Provided that there is a mapping table named "table1", which has keys 10, 20 and 30 with corresponding values "value1", "value2" and "value3":
println(map("table1", 20)); // prints "value2"
println(typeof(map("table1", 40))); // prints "null"
println(map("table1", 40, "NOT FOUND")); // prints "NOT FOUND"