Language:
Русский
English
of (reserved word)
The reserved word of is used in array, set, and file type declarations, and in case statements.
Syntax
identifier = array[X..Y] of type
identifier = set of type
identifier = file of type
case expression of <case statement list>
Examples
(* array declaration *)
type
IntList = array[1..100] of Integer;
CharData = array['A'..'Z'] of Byte;
Matrix = array[0..9, 0..9] of real;
(* Set types *)
type
Day = (Sun, Mon, Tue, Wed, Thu, Fri, Sat);
CharSet = set of Char;
Digits = set of 0..9;
Days = set of Day;
(* File type declarations *)
type
Person = record
FirstName: string[15];
LastName : string[25];
Address : string[35];
end;
PersonFile = file of Person;
NumberFile = file of Integer;
SwapFile = file;
(* case statement *)
case Ch of
'A'..'Z', 'a'..'z': WriteLn('Letter');
'0'..'9': WriteLn('Digit');
'+', '-', '*', '/': WriteLn('Operator');
else
WriteLn('Special character');
end;