I have a function that builds a script and executes it with []INBUF. There is a )CLEAR in the middle of the script. It all works fine -- except if the state indicator is not empty.
After a )RESET, the function foo below works as expected.
foo;x
© ŒINBUF probelm with )CLEAR
© 15 Feb 2005 Rex Swain, Independent Consultant, www.rexswain.com
x„ ')wsid',Œtcnl
x„x,')clear',Œtcnl
x„x,')wsid',Œtcnl
0 Œinbuf x
foo
)wsid
IS 5 INBUF
)clear
CLEAR WS
)wsid
IS CLEAR WS
But if you execute the function goo below, and then run foo again with goo suspended, the )CLEAR does not take effect until the end of the script.
goo
2÷0
goo
DOMAIN ERROR
goo[1] 2÷0
^
foo
)wsid
IS 5 INBUF
)clear
)wsid
IS 5 INBUF
CLEAR WS
In a more complicated case, the )CLEAR seems to never be executed.