Assign a value to a variable
assignment
Use variable assignment syntax to declare and assign a value to a new variable, or reassign a different value to an existing variable.
Syntax
The variable assignment syntax consists of three things:
- A variable name
- An equals sign
- The variable's value
Variable names begin with a dollar-sign $ and may be composed of alphabetic characters A-Z, a-z, numerals 0-9, and dashes -.
Values may be delimited with apostrophes ' ' or quotation-marks " "; both of these may be omitted when the value does not have any spaces.
When a variable is assigned for the first time, its value is added to the BLUEPROCESSOR internal dictionary.
When a variable is reassigned, the internal dictionary's value is replaced with the new value.
When a variable name is typed into a manuscript (without assigning a value to it), its internal dictionary value is injected into the compiled document.
Other ways to use variable assignment
It's possible to assemble one or more variables into a new variable using an assignment like this.
If a variable is going to be reassigned, it is possible to save its current value and restore it later by using a pair of assignments like this:
Examples
Here is what variable assignment looks like within the body of a manuscript.