program file_test;
{$MODE DELPHI}
{$IFDEF WINDOWS}
{$codePage UTF8}
{$ENDIF}
uses
SysUtils;
procedure TrataErrro;
var
LValor: Integer = 0;
begin
try
LValor := 5 div LValor;
WriteLn('erro de divisão por zero ', LValor);
except
on E: Exception do
begin
WriteLn('Ocorreu um erro ao tentar operação: ', E.Message);
end;
end;
end;
begin
if not FileExists('c:\temp\teste4.txt') then
WriteLn('Arquivo não existe.');
WriteLn('Programa continua');
TrataErrro;
end.