User`s manual

Constant is data whose value cannot be changed during the runtime. Every con-
stant is declared under unique name which must be a valid identifier. It is a good
practice to write constant names in uppercase.
In mikroBasic, constants have to be of simple data type (no arrays or strings are
allowed).
Example of constant declaration:
const MAXVALUE = 237
Constants can be used in any legal expression, but they cannot be assigned a new
value. Therefore, they cannot appear on the left side of the assignment operator.
If you frequently use the same value throughout the program and its value is fixed,
you should declare it a constant (for example, maximum number allowed is 1000).
This is a good practice since the value can be changed simply by modifying the
declaration, instead of going trough the entire program and adjusting each instance
manually. As simple as this:
const MAX = 1000
It is important to understand why constants should be used and how this affects
the MCU. Using a constant in a program consumes no RAM memory. This is very
important due to the limited RAM space (PIC16F877 has 368 locations/bytes).
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
36
mikroBASIC
MikroElektronika: Development tools - Books - Compilers
making it simple...
page
CONSTANTS
Note
Constants
and PIC