Warum machst Du denn nicht so etwas?:
Delphi-Quellcode:
var
Position: Byte;
Labels: array[0..9] of TLabel;
procedure Initialize;
var
i: Byte;
begin
for i := 0 to 2 do
Labels[i].Color := clRed;
for i := 3 to 9 do
Labels[i].Color := clBack;
Position := 1;
end;
procedure MoveRight;
begin
Labels[(Position+9) mod 10].Color := clBlack;
Position := (Position+1) mod 10;
Labels[(Position+1) mod 10].Color := clRed;
end;
procedure MoveLeft;
begin
Labels[(Position+1) mod 10].Color := clBlack;
Position := (Position+9) mod 10;
Labels[(Position+9) mod 10].Color := clRed;
end;
In "Position" steht gerade die Nummer des mittleren der drei Labels, die gerade leuchten.