Ver Mensaje Individual
  #8  
Antiguo 04-08-2010
Thoronluin Thoronluin is offline
Miembro
 
Registrado: feb 2009
Posts: 39
Reputación: 0
Thoronluin Va por buen camino
He estado trabajando con lo explicado y funciona genial.

Otra pregunta. Me gustaría ir más allá y hacer una lista con las colas pero no tengo claro como acceder a las colas. Yo hago lo siguiente

Código Delphi [-]
var
  ....
  lista: Tlist;
  aux_Elemento: Telemeto;
  aux_Cola: Tqueue;
  ...

procedure TForm1.FormCreate(Sender: TObject);
var
  i: integer;
begin
  lista:=tlist.Create;
  for i:=0 to 3 do
  begin
    aux_Cola:=tqueue.Create;
    lista.Add(aux_Cola);
  end;
end;

procedure TForm1.I1Click(Sender: TObject); 
// Pulsado un botón introducimos un texto
begin
  aux_Elemento:=Telemento.Create;
  aux_Elemento.cadena:=Texto_Entrada1.Text;
  aux_cola:=lista.Items[0];
  aux_cola.Push(aux_elemento);
  Texto_Contador1.Text:=inttostr(aux_cola.Count);
end;

No sé si es la manera estándar o si existiría una forma más directa , sé que lo siguiente no es correcto:

Código Delphi [-]
lista.Items[0].Push(aux_Elemento);

Saludos y gracias por la paciencia.
Responder Con Cita