All pastes #28926 Raw Edit

Someone

public text v1 · immutable
#28926 ·published 2005-11-16 17:23 UTC
rendered paste body
procedure TForm1.Button4Click(Sender: TObject);
var
  i:integer;
begin
  IdTCPClient.Disconnect;
  try
  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];
      
        IdTCPClient.Connect();
       
        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;
  except
    ShowMessage( 'Error' )
  end;
end;