Skip to content

Instantly share code, notes, and snippets.

@ldaniel
Created January 30, 2012 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldaniel/1705819 to your computer and use it in GitHub Desktop.
Save ldaniel/1705819 to your computer and use it in GitHub Desktop.
Manipulando exceções em Delphi 4.0
procedure TForm1.FormCreate(Sender: TObject);
var
Buffer : Pointer;
begin
Buffer := AllocMem(1024);
try
{ Codigo que pode gerar uma excecao }
finally
FreeMem(Buffer);
end;
end;
{ Ou ainda }
procedure TForm1.TratarExcecao(Sender : TObject; E : Exception);
begin
{ Codigo para tratar a excecao }
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment