[fpc-pascal]Destroy Instance

Luis Del Aguila aguila3000 at terra.com.pe
Tue Jan 28 19:18:22 CET 2003


I don't Understand, I compile this code with FPC 1.06 for Windows and the
directive compiler -S2 -Rintel.
is it a bug?.

Thanks


Type
  TClase1 = Class
    campo1:string;
  End;
  TClase2 = Class (TClase1)
    campo2:string;
  End;

Var b:Tclase2;
Begin
  b:=TClase2.create;
  b.campo1:='hola';
  b.campo2:='hola2';
  Writeln(b.campo2);
  b.destroy;             //if destroy the instance .
  Writeln(b.campo2);     // Why the instance exist?
  Write('presione enter para terminar');readln
End.





More information about the fpc-pascal mailing list