mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-28 03:13:41 +02:00
18 lines
255 B
ObjectPascal
18 lines
255 B
ObjectPascal
Program Example45;
|
|
|
|
{ Program to demonstrate the Ord function. }
|
|
|
|
Type
|
|
TEnum = (Zero, One, Two, Three, Four);
|
|
|
|
Var
|
|
X : Longint;
|
|
Y : TEnum;
|
|
|
|
begin
|
|
X:=125;
|
|
Writeln (Ord(X)); { Prints 125 }
|
|
Y:= One;
|
|
Writeln (Ord(y)); { Prints 1 }
|
|
end.
|