Re: possible to skip code from sub functions?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Do this without an exception or a return value on any function:

class Jump {
void A() { if(some good reason) throw new Exception(); }
void B() { DestroyTheEarth(); }
void C() { Disarm() ; }
}

main() {
Jump j = new Jump();
try {
j.A();
j.B();
}
catch () { }
finally {
j.C();
}
}


Basically I'm wondering if I can code my own try/catch/finally
structure. I was picturing passing my own exceptions into the try
function and my own delegates to call on catch/final as well. I could
then have my classes call my own throw function. What I can't figure
out how to do is make it skip code. Can I, from my own code, force an
exit from the current scope? Or make it jump back to the scope level
that my custom Try function was called at?

.



Relevant Pages

  • Re: possible to skip code from sub functions?
    ... void A{ifthrow new Exception();} ... void B ... Jump j = new Jump; ...
    (microsoft.public.dotnet.languages.csharp)
  • [patch v2] x86: Add testcases for RODATA and NX protections/attributes
    ... +config DEBUG_RODATA_TEST ... this implies having dynamic exception handling table entries. ... +static void test_exit ...
    (Linux-Kernel)
  • Re: Object reference not set to an instance of an object.
    ... > The event handler WTGDataRowReady10Handler is called by a delegate in the ... > catch (Exception ex) ... > private void WTGDataRowReady10Handler( ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: N1298 - try/finally for C
    ... Using a void*, or something containing a void*, gives ... Then we have a function that potentially throws an exception: ... If you mean some custom allocator, then we generally need to pass yet ... As for function pointers, and besides that throwing function pointers ...
    (comp.std.c)
  • [RFC] Improved versioned pointer algorithms
    ... The orphan test is used in snapshot write and exception delete to ... The current method of determining whether a ghost exception is an ... its child count then the ghost exception is an orphan, ... void set_bit ...
    (Linux-Kernel)