type
TSound = (tsClick, tsClack, tsClock);
TMyColor = (mcRed, mcBlue, mcGreen, mcYellow, mcOrange);
Answer = (ansYes, ansNo, ansMaybe)
You can use the
(val1, ..., valn) construction directly in variable declarations, as if it were a type name:
var MyCard: (Club, Diamond, Heart, Spade);
But if you declare
MyCard
this way, you can't declare another variable within the same scope using these constant
identifiers. Thus
var Card1: (Club, Diamond, Heart, Spade);
var Card2: (Club, Diamond, Heart, Spade);
generates a compilation error. But
var Card1, Card2: (Club, Diamond, Heart, Spade);
compiles cleanly, as does
type Suit = (Club, Diamond, Heart, Spade);
var
Card1: Suit;
Card2: Suit;
Dostları ilə paylaş: