You can use the assignment operator (:=) with only Crystal syntax.
Usage
x := n
Assigns the value n to the variable x. (x must have already been declared in the same formula.)
Examples
The following examples are applicable to Crystal syntax:
Amount:= 0
Initializes (sets to zero) the variable named Amount.
Amount:= 100
Assigns the value 100 to the variable named Amount.
Amount:= Amount + {file.QTY}
Assigns the result of a calculation to the variable named Amount. The calculation adds the value of the quantity field ({file.QTY}) to the current value of the Amount variable.
Amount:= {file.QTY1} + {file.QTY2} + {file.QTY3}
Totals the three quantity fields and assigns the total to the variable named Amount.
Customer:= "Westside Motors"
Assigns the string "Westside Motors" to the variable named Customer.
Customer:= {customer.FIRST NAME} + {customer.LAST NAME}
Concatenates two fields and assigns the concatenated value of both fields to the variable named Customer.
Customer:= TrimRight({customer.FIRST NAME}) + {customer.LAST NAME}
Trims the trailing blanks from the first name field ({customer.FIRST NAME}), concatenates that field to the last name field ({customer.LAST NAME}), and assigns the concatenated value of both fields to the variable named Customer.
Customer:= "Mr. " + {customer.LAST NAME}
Concatenates the string "Mr. " with the value of the last name field {customer.LAST NAME} and assigns the concatenated value to the variable named Customer.
Amount:= 100; Customer:= "Westside Motors"
Assigns the constant 100 to the number variable named Amount and assigns the string "Westside Motors" to the string variable named Customer. You can assign values to multiple variables by separating the assignment statements with semicolons.