type
TDay = (Mon=1, Tue, Wed, Thu, Fri, Sat, Sun); // Defines enumeration range
procedure TForm1.W3Button12Click(Sender: TObject);
var
today : TDay; // Defines enumeration variable
weekend : Boolean;
begin
today := Wed; // Set today to be Wednesday
if today > Fri // Ask if it is a weekend day
then weekend := true
else weekend := false;
WriteLn('If today is Wed then weekend is: '+ weekend.ToString);
for today := Mon to Fri do
begin
// day has each of the values Mon to Fri ( 1 to 5) in 5 iterations
// of this loop, allowing you to whatever you want.
WriteLn ( ord(today) );
end;
|