Ver Mensaje Individual
  #8  
Antiguo 16-09-2004
Mick Mick is offline
Miembro
 
Registrado: may 2003
Posts: 405
Reputación: 22
Mick Va por buen camino
Si es para una loteria y no son muchisimos telefonos (no mas de unos cuantos miles), seria mejor elegirlos al azar como explica Neftali o maruenda, e ir eliminadolos de la lista, para que no se vuelvan a usar, ej:

Código:
var
 List : TStringList;
 Index: integer;
begin
  List:= TStringList.Create;
  try
    List.LoadFromFile('mistelefonos.txt');
    while List.Count>0 do begin
        Index:= random(List.Count); 
        Memo1.Lines.Add(List[Index]);
        List.Delete(Index);
    end{while};
  finally
    List.Free;
  end;
end;
Saludos
Responder Con Cita