| EQU | Index Level | EREPLACE |
| Syntax |
EQU{ATE} symbol TO char(constant) {,variable TO expression...}
EQU{ATE} symbol TO variable |
| Category | BASIC |
| Type | Statement |
| Description |
a compiler directive which declares a constant at compile time or a synonym of another variable or array element.
Note: "expressions" in an "equ" are limited to constant expressions, variables, and character strings. "equate" can also be used to assign meaningful variable names to array elements. Once "equate" has been used to assign a value to a symbol, the variable cannot be used as a variable and cannot be reassigned a value. Equate definitions must be placed before any usage of the equated symbols. Failure to do so may generate compile-time errors. |
| Options | |
| See Also | EQU statements & functions assignment |
| Example |
equ form.feed to char(12)
equ ring.bell to char(7) equ attribute.mark to char(254) ... read array from file,id... amcmax = dcount(array,attribute.mark) .... if ctr=pagemax then print form.feed crt ring.bell: end ... This example shows how "equ" can make more descriptive cryptic references like "char()". equ customer.name.attribute to 1 equ title to "REF" equ invoice.number to customer.item(13) ... print @(15,0):title print customer.item(customer.name.attribute) ... read invoice from invoice.file,invoice.number then ... "equ" designates a synonym for the numeric constant 1, the string "REF" and the 13th variable in the dimensioned array "customer.item". equ x to a a = 3 print x The symbol "x" is a synonym for the variable "a" and can be used interchangeably. |
| Warnings | |
| Compatibility | D3 7.0 AP R83 |
| EQU | Index Level | EREPLACE |