Ver Mensaje Individual
  #1  
Antiguo 30-04-2015
Avatar de bulc
bulc bulc is offline
Miembro
 
Registrado: jun 2010
Posts: 416
Reputación: 17
bulc Va por buen camino
Me sale I/O error 125, ¿qué hago mal?

Estoy practicando con TList y este código me da ese error. Por favor, ¿me podéis decir qué está mal?
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
Const
   Const_A: Array[1..6] of String =( 'a', 'b', 'c', 'd', 'e', 'f');
var
  I: Integer;
  Element: Integer;
  Lista: TList;
  Dato : String;
begin
  Memo1.Clear;
  Randomize;
  try
    Lista := TList.Create();
    try
      for I := 1 to High(Const_A) do
        begin
          Lista.Add( Pointer( I ));
        end;
     repeat
        Element := Random(Lista.Count);
        Dato := Const_A[Element];
        Memo1.Lines.Add( IntToStr (Element) +'   '+ Dato );  // Const_A[Elemento]
        Lista.Delete(Element);
      until Lista.Count = 0;
     finally
       Lista.Free;
    end;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end;
Quería hacer un TList de integers, pero no lo consigo.
Gracias por vuestra ayuda.
bulc
Responder Con Cita