Contents Previous Next Subchapters

Assigning Values To Constants
Syntax const constant = value
See Also assignment

Assigns a value to the specified constant.

The constant directive sets a constant equal to a value. Once a constant is defined, it cannot be reassigned. The name used for the constant must not be previously defined.

For example, if you enter
     const I = 1i0
     print I
O-Matrix will respond
If you then try to reassign I by entering
     I = 2i0
O-Matrix will respond with an error message.

Using With Functions
Constants defined outside of any function have global scope and are automatically visible with in all functions (see the discussion on constants in the Using Variables And Constants With Functions section).