Hi Jean-Louis,

also thank you very, very much for this research and insights, which
might help achieve what I have (always) wanted to achieve: in the case
of BSF4ooRexx supplying the Java Throwable object as an additional piece
of information by supplying it in an array at a position that follows
the error messag substition values!

Best regards,

---rony




On 03.06.2011 02:41, Jean-Louis Faucher wrote:
>
>     Now, stumbling over "RaiseCondition()"-function, I was wondering,
>     whether the following could be achievable with this:
>
>         * raising a syntax condition by supplying as strConditionName
>           the value "SYNTAX", but if so, how could I supply the
>           syntaxErrorNumber?
>         * supplying a directory object containing entries that further
>           describe the condition as the argument
>           "optionalAdditionalConditionObj"? This would allow e.g. for
>           BSF4ooRexx to make the Java condition object available to
>           the Rexx side.
>
> 2011/6/1 Rony G. Flatscher <rony.flatsc...@wu-wien.ac.at
> <mailto:rony.flatsc...@wu-wien.ac.at>>
>
> RaiseException(size_t n, RexxArrayObject ao)
> is implemented by
> void RexxActivity::raiseException(wholenumber_t  errcode, RexxString
> *description, RexxArray *additional, RexxObject *result)
>
> where errcode=n, description=null, additional=ao, result=null
>  
... cut ...

> You will see that raiseException creates a conditionobj by calling
> createExceptionObject(errcode, description, additional, result)
> then calls raiseCondition(conditionobj)
> and then propagate the condition if it was not caught.
>
> So we have two differences between raiseException and raiseCondition :
> - the condition object created by raiseException is specific for
> SYNTAX. In particular, the additional is used to build a secondary
> message with substitution.
> - the condition object is propagated through the call stack
>
> I have a question.
> You wrote "raiseException does not allow to supply a program generated
> object which would carry additional information in case of an exception".
> Did you say that because the additional object is used to build the
> secondary message ?
No, well ..., ... so far I have simply not realized that possibly
supplying an array object with entries at indices that are higher than
the index of the last message substituion text, would work!

Actually I just tried it via Rexx witht the following code:

    signal on syntax
       arr=.array~of("eins", "zwei", .object~new, "drei")   -- e.g. say 1/0

       raise syntax 42.3 additional (arr)
       exit

    syntax:
       co=condition('o')
       call dump2 co, "Syntax condition object: dump2(co)"
       say
       call dump2 co~additional, "additional information"

       trace ?r
       say "enter your stuff, enter trace off to stop..."

    ::requires "rgf_util2.rex"

      

The output is:

    F:\test\orx\raise>test.rex
    Syntax condition object: dump2(co): (13 items)

        #  1: index=[ADDITIONAL]  -> item=[an Array (4 items) id#_266367018]
        #  2: index=[CODE]        -> item=[42.3]
        #  3: index=[CONDITION]   -> item=[SYNTAX]
        #  4: index=[DESCRIPTION] -> item=[]
        #  5: index=[ERRORTEXT]   -> item=[Arithmetic overflow/underflow]
        #  6: index=[INSTRUCTION] -> item=[SIGNAL]
        #  7: index=[MESSAGE]     -> item=[Arithmetic overflow; divisor must 
not be zero]
        #  8: index=[PACKAGE]     -> item=[a Package id#_266367210]
        #  9: index=[POSITION]    -> item=[4]
        # 10: index=[PROGRAM]     -> item=[F:\test\orx\raise\test.rex]
        # 11: index=[PROPAGATED]  -> item=[0]
        # 12: index=[RC]          -> item=[42]
        # 13: index=[TRACEBACK]   -> item=[a List (1 items) id#_266367164]
    --------------------------------------------------

    additional information: (4 items)

        # 1: index=[1] -> item=[eins]
        # 2: index=[2] -> item=[zwei]
        # 3: index=[3] -> item=[an Object id#_266367015]
        # 4: index=[4] -> item=[drei]
    --------------------------------------------------
           +++ "WindowsNT COMMAND F:\test\orx\raise\test.rex"
        14 *-* say "enter your stuff, enter trace off to stop..."
           >>>   "enter your stuff, enter trace off to stop..."
    enter your stuff, enter trace off to stop...
    +++ Interactive trace. "Trace Off" to end debug, ENTER to Continue. +++
    exit
      


> According to what I see in createExceptionObject, if the syntax error
> code has no decimal extension (ex : 3), then no secondary message is
> build, and you can pass what you want in the additional object.
> When a secondary message is built (ex : error 3.001), I think it's
> possible to pass extra entries in the additional object, whose index
> is greater than the greatest substitution number. Ex : with "my
> message &1 &2", you can store extra informations in additional[3].
Yes, I think you are right!

Will apply this knowledge for BSF4ooRexx first, as it always has bugged
me to not be able to supply the Java Throwable object with the Rexx
syntax condition to the Rexx coder for further inspection, in case there
is a need for it.

Again, thank you very much for your efforts, which help a lot !

Best regards,

---rony




------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to