1 var
2 cl : array[0 .. 2] of TColor = (clGreen, clRed, clYellow);
3 curr : integer = 0;
4
5 procedure TForm1.Button1Click(Sender: TObject);
6 begin
7 curr := succ(curr) mod 3;
8 Color := cl[curr];
9 end;
10
11 procedure TForm1.FormCreate(Sender: TObject);
12 begin
13 Color := cl[curr];
14 end;