7. Embedded QUEL for Pascal : Pascal Variables and Data Types : Variable and Type Declarations : Varying Length String Type Definition
 
Share this page                  
Varying Length String Type Definition
The declaration for a varying length string type definition has the following syntax:
type varying_type_name = varying [upper_boundof char_type_name;
Syntax Notes:
1. The upper_bound of a varying length string specification is not parsed by the EQUEL preprocessor. Consequently, an illegal upper bound (such as a non-numeric expression) will be accepted by the preprocessor but will later cause Pascal compiler errors. For example, both of the following type declarations are accepted, even though only the first is legal in Pascal:
##  type
##    String20 = varying[20] of Char;
##    What     = varying['upperbound'] of Char;
2. EQUEL/Pascal treats a variable of type varying of char as a string, not an array.
##  type
##      Pname = varying[100] of Char;
##  var
##      user_name : Pname;
  ...
##  append to person (name = user_name)