next up previous contents index
Next: Paramcount Up: Functions and Procedures Previous: Ofs

Ord

   

Declaration:

Function Ord (X : Ordinal type) : Byte;

Description:

Ord returns the Ordinal value of a ordinal-type variable X.

Errors:

None.

See also:

Chr

Example
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.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998