Analyzing the contents of the condition object  in order to create the
lines ooRexx creates, if run on the command line and hitting an error. 
(This is intended to be returned in form of a message string to Java, in
case a syntax error occurs on the Rexx side.)

It seems that the traceback list does not contain the starting line, and
that line cannot be retrieved from the information in the condition object.

Maybe an example illustrates what should be achieved:

    -- signal on any           -- line # 1
    call nested_level       -- line # 2
    exit                    -- line # 3

    any:                    -- line # 5
      o=condition("O")
      call dump2 o, "condition object"
      call dump2 o~traceback, "traceback"

    -- contains a routine dump2() for dumping collections
    ::requires rgf_util2    -- line # 11

    ::routine nested_level  -- line # 13
      say 1/0               -- line # 14
      

Running the above program on the command line yields the following output:

        14 *-* say 1/0               -- line # 14
         2 *-* call nested_level       -- line # 2
    Error 42 running 
E:\rony\dev\bsf\src\source_cc_40\tests\misc\testException.rex line 14:  
Arithmetic overflow/underflow
    Error 42.3:  Arithmetic overflow; divisor must not be zero
      

[Minor observation: it seems that the lines in the traceback do not
contain leading whitespace. Is that intentional?]


Running the same program, removing the line comment from the very
beginning of the first line will cause the code at the "any" label to be
executed. There the content of the condition object is dumped (public
routine "dump2()" from rgf_util2, which I will be presenting at this
year's Rexx symposium) and the traceback list, which is part of the
condition object. This is the output:

    E:\rony\dev\bsf\src\source_cc_40\tests\misc>testException.rex
    condition object: (13 items)

        #  1: index=[ADDITIONAL]  -> item=[an Array (0 items) id#_266380628]
        #  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#_266380692]
        #  9: index=[POSITION]    -> item=[14]
        # 10: index=[PROGRAM]     -> 
item=[E:\rony\dev\bsf\src\source_cc_40\tests\misc\testException.rex]
        # 11: index=[PROPAGATED]  -> item=[1]
        # 12: index=[RC]          -> item=[42]
        # 13: index=[TRACEBACK]   -> item=[a List (1 items) id#_266380646]
    --------------------------------------------------
    traceback: (1 items)

        # 1: index=[0] -> item=[    14 *-* say 1/0               -- line # 14]
    --------------------------------------------------
      

It seems that the traceback list in the condition object is incomplete
as line # 2 is missing from it.
Is this intentional or a bug? If intentional, how could one get at that
line from the condition object?

---rony

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to