Delphi has a precedure named "Abort".The following is picked up from Delphi help: Use Abort to escape from an execution path without reporting an error.Abort raises a special "silent exception" (EAbort), which operates like any other exception, but does not display an error message to the end user. Abort redirects execution to the end of the last try .. finally block.
EAbort = class(Exception);
procedure Abort;
function ReturnAddr: Pointer;
asm
MOV EAX,[EBP - 4]
end;
begin
raise EAbort.Create(SOperationAborted) at ReturnAddr;
end;
I'm now going to .Net. I can not find any method Similar to the "Abort" procedure.Is it possible to to write c# version of Delphi's "Abort" procedure like this?
try //application level try .. finally block
{
try
{
...
try //Current level try .. finally block
{
...
// Throw a SilentException that will only catched by application level try .. finally block
// and redirects execution to the end of application level try .. finally block
Abort; //How to??????????????????????????
...
}
catch
{
}
}
catch
{
}
}
catch ()
{
}
finally
{
}
...
Can anyone help me? Any suggestion wil be appropriate. Thanks a lot. .
Forgive my poor English