Zoomscript includes a powerful concatenation feature which joins a variety of strings together into a single string. This is useful for calling procedures and parsing a concatenated string. This feature can also extract variable values for use in the string output.
The concatenation structure supports the following:
Strings
Variable values
Integers
Real numbers
Booleans
Characters
The concat structure is identified by the following format where N = number of values.
([value1],[value2],...,[valueN])
There is no limit for the number of values. The structure consists of any number of values with commas in between. No spaces are needed. Each end has a round bracket. Invalid values will cause a ParamError crash.
If the value is a variable, the variable's value will be extracted and joined into the string.
The most basic example. Redundant as the strings are fixed, but shows how the feature works in its most basic form.
Example 1: joining strings
The most basic example. Redundant as the strings are fixed, but shows how the feature works in its most basic form.
Example 2: using variable values
Example 3: circle area program
This program uses the concatenation feature for the math function, as the math function only accepts one parameter.