I want to change the font color of a TLabel, based on the value that i got from an Integer.
var
i: Integer;
begin
ValueGenerator (i);
if i <= 14 then
begin
L1.Font.Color := clBlue;
end;
if i >= 15 then
begin
L1.Font.Color := clGreen;
end;
if i <= 29 then
begin
L1.Font.Color := clGreen;
end;
if i >= 30 then
begin
L1.Color := clYellow;
end;
if i <= 49 then
begin
L1.Color := clYellow;
end;
if i >= 50 then
begin
L1.Color := clRed;
end;
L1.Caption := IntToStr(i);
end;
The value output is from 0 to 100. What ever value I got, my TLabel is always on clGreen. What I did wrong here?
elsein there to make it pick only one, but even so I would restructure this code. Perhaps acaseis what you really want?else.