Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function Pred(X);
Rreturns the predecessor of the ordinal value.
Pred goes to the element listed before X in the type declaration. Pred(x) is the same as Dec(x,1) - the diference is that Dec changes the x variable (it's procedure) and Pred does not (function).
type TExperience=(Beginner, Intermediate, Advanced);
var aProg : TExperience;
aProg := Intermediate;
aProg := Pred(aProg);
//aProg = Beginner
|
Ordinal and Enumerated Data Types
Learn about Delphi's support for ordinal types. Extend Delphi's built-in types by constructing your own types.
Inc,
Succ,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|