Pascal (programming language): Difference between revisions

Content deleted Content added
Records and arrays can be declared recursively
Complex type declarations
Line 284:
end;
c = file of a;
</syntaxhighlight>
 
Further, complex types can be constructed from other complex types recursively:
 
:<syntaxhighlight lang="pascal">
const
Jack = 11;
Queen = 12;
King = 13;
Ace = 14;
 
type
valueType = 2..Ace;
suitType = club, diamond, heart, spade;
 
cardType = record
suit: suitType;
value: valueType;
end;
 
deckType = array [1..52] of cardType;
 
person = record
surname: packed array [1..20] of char;
age: integer;
end;
 
table = record
hands: array [1..3] of deckType;
players: array [1..4] of person;
end;
</syntaxhighlight>