var MySet: set of 'a'..'z';
...
MySet := ['a','b','c'];
Other examples of set types include
set of Byte
set of (Club, Diamond, Heart, Spade)
set of Char;
The in operator tests set membership:
if 'a' in MySet then ... { do something } ;
Every set type can hold the empty set, denoted by [].
Arrays
An array represents an indexed collection of elements of the same type (called the base type). Because each element
has a unique index, arrays, unlike sets, can meaningfully contain the same value more than once. Arrays can be
allocated
statically or
dynamically.
Dostları ilə paylaş: