# equate statement

The equate statement is a compiler directive
that declares a constant at compile time or a synonym of another variable
or array element.

**Synonyms:** equ

## Syntax

```
equate symbol to char(constant) {,var to exp...}
equate symbol to var
```

## Description

Note: Expressions in an equate statement are limited to constant expressions, variables,
and character strings.

The equate statement
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 can
generate compile-time errors.

## Example(s)

```
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
...
```

## See also

- [Assignment](https://d3codex.com/pickbasic-flashbasic/assignment/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)

---
Source: https://d3codex.com/pickbasic-flashbasic/equate-statement/ - part of the D3Codex reference.
