Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function Succ(X);
Rreturns the successor of the ordinal value.
Succ goes to the element listed after X in the type declaration. Succ(x) is the same as Inc(x,1) - the diference is that Inc changes the x variable (it's procedure) and Succ does not (function).
type TExperience=(Beginner, Intermediate, Advanced);
var aProg : TExperience;
aProg := Intermediate;
aProg := Succ(aProg);
//aProg = Advanced
|
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,
Pred,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|