7. Embedded QUEL for Pascal : Pascal Variables and Data Types : Variable and Type Declarations : Constant Declarations
 
Share this page                  
Constant Declarations
The syntax for a constant declaration is:
const constant_name = constant_expr; 
    {constant_name = constant_expr;}
where a constant_expr is one of the following:
[+|-constant_number
[+|-constant_name
string_constant
Constants can be used to set Ingres values but cannot be assigned values from Ingres.
Syntax Notes:
1. A constant_name must be a legal Pascal identifier beginning with an alphabetic character or an underscore.
2. A constant_number can be either an integer or real number. It cannot be a numeric expression.
3. EQUEL/Pascal recognizes only single, and not double or quadruple, exponential notation for constants of type real.
4. The type of a constant_name is determined from the type of its constant_expr.
5. If a constant_name used as a constant_expr is preceded by a '+' or '-', it must be numeric.
6. EQUEL/Pascal does not support the declaration of arbitrary constant expressions.
##  const
##      min_sal      = 15000.00;      {Real}
##      pi           = 3.14159;       {Real}
##      max_emps     = +99;           {Integer}
##      max_credit   = 100000.00;     {Real}
##      max_debt     = -max_credit;   {Real}
##      yes    = 'y';                 {Char}