All pastes #28923 Raw Edit

Stuff

public text v1 · immutable
#28923 ·published 2005-11-16 17:13 UTC
rendered paste body
procedure TForm1.Button4Click(Sender: TObject);
var
  i:integer;
begin
  IdTCPClient.Disconnect;

  for i := 0 to listviewServers.Items.Count - 1  do
  begin
    Connected := False;
    Error := False;
    IdTCPClient.Port := 4899;
    IdTCPClient.Host := listviewServers.Items.Item[i].SubItems[0];
      try
        IdTCPClient.Connect();
       except
      if IdTCPClient.Connected = True then //the bools tell the app that a port is open
      begin
        listviewServers.Items.Item[i].SubItems[1] := 'Online';
        IdTCPClient.Disconnect;
      end
      else
      listviewServers.Items.Item[i].SubItems[1] := 'Offline';
      IdTCPClient.Disconnect;
    end;
  end;
  end;