You are here: Grammar and Syntax > Assignment Statements

Assignment Statements

Assignment statements give values to target variables. Assignment statements have two parts: a target variable and a source expression. The source expression determines what is used to obtain a result. The target is assigned the result of the calculation. The assignment statement format is:

Target = Source expression

Target variables can be one of these types: string, integer, or decimal. Targets always receive a value that matches their assigned type. Target variables retain data until it is placed in the form set or used in another calculation or expression.

The source expression specifies what calculation is performed. Source expressions can be simple or complex. Simple expressions assign the value of a section variable field to the target, or they assign a constant value to the target variable. Complex expressions calculate results from multiple sources.

Note The result of the source expression is always converted to the assigned type of the target variable, unless the result of the source expression is a decimal.

To view the related topics, view the topics within this book topic in the help Contents pane.