Pascal samples. Enumeration types.


program Demo;
type
  TMyEnum = (red = 2, blue, green, black);
var
  x, y: TMyEnum;
begin
  x := blue;
  writeln(Integer(x));
  y := Pred(x);
  writeln(Integer(y));
  writeln(Integer(Succ(y)));
end.


Copyright © 2006-2017 Alexander Baranovsky. All rights reserved.