Assign

Syntax: @Assign variable = expression

In its simplest form the Assign command can be used to assign a value to an attribute or other variable. However, the expression can contain extensive calculations and utilise several attributes and variables, as well as Functions (square root, cosine etc.). The Assign command can be several lines long.

Assign allows strings to be assigned to Lists, and Lists to be assigned to strings. You can also assign a date to a string, in order to convert a date into a format suitable for manipulation by other commands. e.g. the Copy command to extract the month part from a date.

Values can be assigned to multi select list objects using the Assign command and placing the values in square brackets, for example…

@Assign myList = []

@Assign myList = ['c']

@Assign myList = myList + ['b']

@Assign myList = myList - ['c']

@Assign myList = ['a','d']

The selected values of a multi select list object can be scanned in the following manner…

@For index = 1 to myList.nValues

@If myList.selected[index] = True

@Debug myList.ItemName[index]

@Endif

@Next

Examples of simple assignments

Assignments with calculations

Predefined functions