7. Embedded QUEL for Pascal : Pascal Variables and Data Types : Variable and Type Declarations : Attributes
 
Share this page                  
Attributes
In type definitions, EQUEL allows VMS Pascal attributes both at the beginning of the definition and just before the type name. The only attributes the preprocessor recognizes in type definitions are byte, word, and long. Any optional storage unit constant "(n)" appearing with the attribute is ignored by the preprocessor. The preprocessor also ignores all other attributes, although it allows them.
The following example shows how to use the byte attribute in order to convert a 4-byte integer subrange into a 1-byte variable.
##  var
##  v_i1 : [byte] -128..127;
Note that Pascal requires that a size attribute be at least as large as the size of its type. Therefore, the following declaration would be illegal, because 400 will not fit into one byte:
##  var
##  v_i1 : [byte] 0..400;
EQUEL/Pascal does not allow explicit attribute size conflicts, as, for example:
##  type
##      i1 = [byte] -128..127;
##  var
##      v_i2 : [word] i1;
In addition to appearing in type definitions, attributes can also precede a compilation unit, where they are ignored by the preprocessor, with the exception of the attribute "[inherit('EQUEL')]", which has the same effect as an EQUEL declare statement in the declaration section of the compilation unit. The inherit attribute should appear alone, because the preprocessor discards any attributes that appear with it. For more information using this attribute in EQUEL, see The Inherit Attribute.