Instruction Manual

Language Reference Reference 181
Publication 1398-PM601A-EN-P October 2000
WORDS
ASSIGN
Assign Program Structure
Purpose Assign a name to a text string. The name can be used to represent an actual parameter
on a machine such as COUNT, LENGTH, etc., making the application program easier
to write and read.
Syntax ASSIGN name text
name The name may be up to 32 alphanumeric characters long and
must begin with an alphabetical character. Name can NOT be a
keyword or reserved word.
text The text may be a variable (V, G, F, B, or dedicated variable), a
variable math operation, a constant numerical value, a text string
that could be used in a conditional statement, an input designator
(I10), an output designator (O6), or a text string in double quota-
tion marks to be used with a Print statement.
Remarks Assign statements must be located at the top of the program before any executable
statements. When creating the executable program the compiler replaces name with
text and then compiles the program (the source is not changed).
During program development the Expand Macros compiler option can be set to get a
program listing that shows how the compiler interpreted your ASSIGN statement.
Refer to
Part 2 IQ Master Environment, Edit menu, Compiler Options for more
detailed information.
See Also
Example
ASSIGN COUNT V3 ;COUNT is variable V3
ASSIGN DEPTH G10 ;DEPTH is variable G10
ASSIGN MULT G10 * V2 ;MULT is the result of G10 * V2
ASSIGN TEST F1 = ON ;TEST can be used in a conditional statement -
IF TEST MOVD = 3
ASSIGN OK INPOSN ;OK is the same as the INPOSN flag
ASSIGN GO I7 ;GO is the same as input 7 (I7)
ASSIGN TXT "Length of Move?"
;TXT is a text string to be used with a Print
statement
PRINT TXT ;print Length of Move? on the Operator Terminal