[Overview][Constants][Types][Classes][Procedures and functions][Variables] |
Return ordinal value of an ordinal type.
Source position: system.fpd line 39
function Ord( |
X: TOrdinal |
):LongInt; |
Ord returns the Ordinal value of a ordinal-type variable X.
None.
|
Convert byte value to character value |
|
|
Return next element of ordinal type. |
|
|
Return previous element for an ordinal type. |
|
|
Return highest index of open array or enumerated |
|
|
Return lowest index of open array or enumerated |
Program Example45; { Program to demonstrate the Ord,Pred,Succ functions. } Type TEnum = (Zero, One, Two, Three, Four); Var X : Longint; Y : TEnum; begin X:=125; Writeln (Ord(X)); { Prints 125 } X:=Pred(X); Writeln (Ord(X)); { prints 124 } Y:= One; Writeln (Ord(y)); { Prints 1 } Y:=Succ(Y); Writeln (Ord(Y)); { Prints 2} end.