Now I'm facing a new problem. I just made a loop to ping the first 10 ip's.
192.168.100.1 - 192.168.100.10
Therefore I made a for do loop, but the values won't change till the loop is finished. Than i changed it into a while loop, but result is that same. I remember the same issue back whit pascal, but I don't remember the solution.
I would like to see the label1 and label2 counting up.
And than I put the i into the KFZ string, so the value of KFZ is KFZ1, KFZ2 and so on. But I can't use that whit the Font.Color. Also 'KFZ'+IntToStr(i).Font.Color is not working. Also tried some other options, but always get this error message: unit1.pas(69,59) Error: Illegal qualifier
Is there a way to put a string into a qualifier? I didn't found anything here:
http://www.freepascal.org/docs-html/rtl/system/stringfunctions.htmlprocedure TForm1.Button2Click(Sender: TObject);
var
Pingsend: TPINGSend;
i: integer;
ip,KFZ: string;
begin
i:=0;
while i < 11 do
begin
i:=i+1;
ip:= '192.168.100.' + IntToStr(i);
KFZ:='KFZ' + IntToStr(i);
Label1.caption:= (ip);
Label2.caption:= (kfz);
pingSend := TPINGSend.Create;
Try
PingSend.Timeout :=750;
if PingSend.Ping(ip) = True then KFZ1.Font.Color:=($00AA00) Else KFZ1.Font.Color:=($0000FF);
finally
PingSend.Free;
end;
end;
end;