Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

raise/trap NOVALUE condition

Help
Vladimir
2009-12-07
2012-08-14
  • Vladimir
    Vladimir
    2009-12-07

    Hello,

    Mainline has:

    SIGNAL ON ANY

    1) If NOVALUE is happened in mainline then it is trapped.

    2) If NOVALUE is happened in the method then it is NOT trapped.

    3) Direct RAISE NOVALUE in method is trapped.

    Why second point doesn't work ?

    Thank you in advance,

    Vladimir

     
  • A method invocation is just like an external function call. It does not
    inherit the SIGNAL settings from its caller. It cannot, actually, since the
    label referenced with the original SIGNAL ON call is not even visible inside
    the context of the method call.

     
  • Vladimir
    Vladimir
    2009-12-07

    Hello,

    Can't agree with previous answer:

    1) As I wrote before in point 3. Direct RAISE NOVALUE in method is trapped
    (the control is transfered to the label defined in SIGNAL ON ANY in the
    mainline).

    2) Something like a=0/0 in the method causes SYNTAX condition and the control
    is transfered to the label defined in SIGNAL ON ANY in the mainline.

    Best regards,

    Vladimir

     
  • A RAISE instruction terminates the current call context and raises the
    condition in the caller. This is trapped because your caller has the issued
    the SIGNAL ON ANY instruction.

    SIGNAL ON SYNTAX is special as the condition gets propagated to the entire
    call stack because it's a terminal condition. Again, your caller's signal trap
    gets a chance to trap this.

     
  • Vladimir
    Vladimir
    2009-12-08

    Thank you for the explanation. It looks like I should include SIGNAL ON ANY in
    most of the methods ...

    Best regards,

    Vladimir