next up previous
Next: Procedural types Up: TYPE Previous: Structured types

String types

To declare as new type a succession of characters of variable length ranging from 0 to a maximum declared. The syntax is:

<type identifier > = STRING[<positive integer number>];

If [<positive integer number>] is omitted in type specification for variable declaration, the maximum length 255 is assumed, i.e., the word STRING alone is a predefined type identifier.

Examples:

        TYPE Names: STRING[25]
        VAR Roll: ARRAY[1..1000] OF Names; Trademark: STRING[10];
        LongLine: STRING;
Roll is an array of 1000 elements; each of them is a string that may contain up to 25 characters. LongLine may contain up to 255 characters, Trademark may contain up to 10.



domingo c
Mon Mar 20 11:09:25 PST 2000