Re: [Oorexx-devel] Question ad condition object's traceback list

2009-05-11 Thread Rony G. Flatscher

Rick McGuire wrote:
> This is the correct result.  The traceback only includes lines back to
> the point where the condition was trapped.  Since your internal
> routine call inherits the signal on settings from the call, the error
> trap is triggered while still in the internal routine, so line 2 does
> not get added to the traceback.
>   
>From native code the only piece of information that is available about
conditions is the condition object retrieved by GetCondition(). If it is
not possible to get at the line number where the signal occurred [and
preferably the sourceline(sigl)], then the condition object is in some
use cases unfortunately of no great help

It seems that what is currently missing from the condition object then,
is the value of SIGL and preferably the sourceline(SIGL). Shall I open a
RFE to ask for them, or do you regard that to be useless?

---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


Re: [Oorexx-devel] Question ad condition object's traceback list

2009-05-11 Thread Rick McGuire
This is the correct result.  The traceback only includes lines back to
the point where the condition was trapped.  Since your internal
routine call inherits the signal on settings from the call, the error
trap is triggered while still in the internal routine, so line 2 does
not get added to the traceback.

Rick

On Mon, May 11, 2009 at 2:37 PM, Rony G. Flatscher
 wrote:
> 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
>
>

--
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


[Oorexx-devel] Question ad condition object's traceback list

2009-05-11 Thread Rony G. Flatscher
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