Upon further debugging it is clear that the condition gets cleared. However, there is no transfer
caused by "signal on any" (debugging code was too scarce hence causing the wrong conclusions).
Rather, condition("o") returns still a condition object even though the next command did not raise a
condition. As the calls to condition('o') occur in the same context (all commands issued in the same
routine) it is working as designed. Here an example (with much more debug statements than the
version yesterday):
... cut ...
-- the command 'hello' never raises a condition nor exception
say "command: 'hello'"
address test "hello"
say " RC:" pp(rc) ".rs=".rs
say line
say
-- this will cause a failure condition to be raised in the command handler
-- because neither output nor error got redirected, but are needed to receive
-- the result
say "command: 'rot13 abc'"
*signal on any name myLabel_1****address test "rot13 abc" -- a condition
will be raised*
say ".//\\." .line "no signal transfer occurred, all well!" "<--- <-- <- "~copies(5)
".\\//."
*myLabel_1:*
co=.nil
say "===> ==> => | co="pp(co) "before co=condition('o')"
co=condition('o') -- a condition raised?
say "<=== <== <= | co="pp(co) "before co=condition('o')"
if \co~isNil then say ppCondition2(condition('o'))
say " RC:" pp(rc) ".rs=".rs
say line
say
-- the command ping
-- the command 'ping' never raises a condition nor exception
*signal on any name myLabel_1bb*
say "command: address test ""ping"""
*address test "ping"*
say ".//\\." .line "no signal transfer occurred, all well!" "<--- <-- <- "~copies(5)
".\\//."
*myLabel_1bb:*
co=.nil
say "===> ==> => | co="pp(co) "before co=condition('o')"
co=condition('o') -- a condition raised?
say "<=== <== <= | co="pp(co) "before co=condition('o')"
if \co~isNil then say ppCondition2(condition('o'))
say " RC:" pp(rc) ".rs=".rs
say line
say
say "*--* "~copies(20)
say
... cut ...
The respective output (misleading because of the way the test got written):
... cut ...
command: 'hello'
[RedirectingCommandHandler].handleCommand(slot, address=[TEST],
command=[hello]), counter=[2]
*RC: [Hello, ooRexx! This is your Java RedirectingCommandHandler working
for you!] .rs=0*
-------------------------------------------------------------------------------
command: 'rot13 abc'
[RedirectingCommandHandler].handleCommand(slot, address=[TEST],
command=[rot13 abc]), counter=[3]
iOR=false, iER=false
! iOR
! iER
75 *-* address test "rot13 abc" -- a condition will be raised
>>> "rot13 abc"
+++ "RC(-1)"
===> ==> => | co=[The NIL object] before co=condition('o')
<=== <== <= | co=[a Directory] before co=condition('o')
[ADDITIONAL] =[an Array (1 items) id#_-3169563802865]
[*Neither "output" nor "error" redirected, cannot write any
result*]
[CONDITION] =[*FAILURE*]
[DESCRIPTION]=[rot13 abc]
[INSTRUCTION]=[SIGNAL]
[PACKAGE] =[a Package id#_-3169557663569]
[POSITION] =[*75*]
[PROGRAM]
=[F:\work\svn\bsf4oorexx\branches\850\samples\Java\handlers\commandHandlers\20_redirectingCommandHandler850\testAddC
ommandHandler.rex]
[PROPAGATED] =[0]
[RC] =[-1]
[RESULT] =[-1]
[STACKFRAMES]=[a List (1 items) id#_-3169563808177]
[ 75 *-* address test "rot13 abc" -- a condition will
be raised id#_-3169563809361]
[TRACEBACK] =[a List (1 items) id#_-3169563808497]
[ 75 *-* address test "rot13 abc" -- a condition will
be raised]
*RC: [-1] .rs=-1*
-------------------------------------------------------------------------------
command: address test "ping"
[RedirectingCommandHandler].handleCommand(slot, address=[TEST],
command=[ping]), counter=[4]
*.//\\. 92 no signal transfer occurred, all well! <--- <-- <- <--- <-- <- <--- <--
<- <--- <--
<- <--- <-- <- .\\//.*
===> ==> => | co=[The NIL object] before co=condition('o')
<=== <== <= | co=[a Directory] before co=condition('o')
[ADDITIONAL] =[an Array (1 items) id#_-3169563802865]
[*Neither "output" nor "error" redirected, cannot write any
result*]
[CONDITION] =[*FAILURE*]
[DESCRIPTION]=[rot13 abc]
[INSTRUCTION]=[SIGNAL]
[PACKAGE] =[a Package id#_-3169557663569]
[POSITION] =[*75*]
[PROGRAM]
=[F:\work\svn\bsf4oorexx\branches\850\samples\Java\handlers\commandHandlers\20_redirectingCommandHandler850\testAddC
ommandHandler.rex]
[PROPAGATED] =[0]
[RC] =[-1]
[RESULT] =[-1]
[STACKFRAMES]=[a List (1 items) id#_-3169563808177]
[ 75 *-* address test "rot13 abc" -- a condition will
be raised id#_-3169563809361]
[TRACEBACK] =[a List (1 items) id#_-3169563808497]
[ 75 *-* address test "rot13 abc" -- a condition will
be raised]
*RC: [Pong!] .rs=0*
-------------------------------------------------------------------------------
... cut ...
Again, this is not an error but working as designed so sorry for this post.
---rony
On 24.08.2022 20:15, Rony G. Flatscher wrote:
While testing redirecting command exit handlers one test program causes intentionally a failure
condition to be raised in the RexxExitContext which gets trapped with a "signal on any name
someLabel" in the invoking context upon return from the handler.
From then on whenever a new "signal on any name someNextLabel" is stated before invoking the
command handler again (without causing any new condition in it) will cause upon return the
transfer to "someNextLabel" and supplies as the condition object with condition('o') the condition
information of the previous condition.
Is it possible that the condition that got raised in the RexxExitContext is not cleared before the
next invocation of the command handler such that upon return it gets triggered again if a new
"signal on any" is in effect?
---rony
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel