@kickahaSiPAriuM: "Hi folks!
I'm in serious trouble when using the subjected (funny word in this context
:oD) sysrpl command. I want to use it to evaluate a string passed by the
user in an inputline.
To avoid strange results (E.G.: The user types only "SIN"; it's obvious
he/she forgot the argument, and I don't want that DOSTR> for this string
evaluate the SIN of the arg that already was in the stack), I've thinked to
save all the rpn stack in the virtual stack before trying to evaluate the
string. The problem is that if a syntax error occurs I can't pop the
previously saved stack! That's very annoying, isn't it?
Anyone has any idea on how save the stack, to evaluate the passed string and
restore the stack indipendtly on errors during string evaluation?
Thx to all!
Kickaha
Per rispondere rimuovere il SiPAriuM
To reply remove the SiPAriuM"
    @jdb: "On Thu, 6 Nov 2003 23:06:21 +0100, "Kickaha"
<quote>
888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4
...
TRUE 1LAMBIND ( Set DOSTR> error flag )
ERRSET
888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 DOSTR> FALSE 1PUTLAM ( Clear DOSTR> error flag ) EVAL ;
ERRTRAP
888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4
1GETLAM
case 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 ... ( Handle DOSTR> errors ) ... ; 
... ( Handle other errors ) ... 
;
ABND
...
;
-
Jonathan Busby - <email_address>
Remove the random permutation of "NOSPAM" from my e-mail address
before replying."
    @jdb: "On Thu, 06 Nov 2003 22:29:59 -0600, Jonathan Busby
<quote>
If you didn't want to evaluate the result of DOSTR> , then the above
simplifies to 
888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4
...
ERRSET
DOSTR>
ERRTRAP
888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 ... ( Handle DOSTR> errors ) ... ;
...
;
which is a simple and elementary error trapping structure.
The virtual stack behaves exactly like the DO-LOOP or temporary
environments with respect to error generation and trapping. For more
information on the virtual stack, see :
<url> ( Explanation by Jean-Yves
Avenard of the inner working of the virtual stack as well as listing
describing each of the supported API functions ). Or for in depth
explanations on the RPL error generation and trapping mechanisms, see
<url> ( RPLMAN ) or
<url> ( Programming in System RPL
by Eduardo M. Kalinowski et al ) .
-
Jonathan Busby - <email_address>
Remove the random permutation of "NOSPAM" from my e-mail address
before replying."
    @jdb: "On Thu, 06 Nov 2003 22:29:59 -0600, Jonathan Busby
<quote>
Seems I neglected to take into account an important part of DOSTR>'s
behavior (posting while half asleep is not recommended) in that I
forgot it evaluates the result of palparse. So, in order to make sure
that a syntax error is due to palparse and not the result of
evaluating the compiled object, you'll need to call palparse directly.
I don't know why you're using DOSTR> anyway, other than possibly to
save a few bytes, but that doesn't work in this situation.
888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4
...
palparse ?SKIP 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 .. ( Handle syntax errors ) ... ;
ERRSET
EVAL
ERRTRAP
888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 ... ( Handle errors due to evaluating the resultant object ) ... ;
...
;
Again, this is a very simple error trapping construction.
See the last two links mentioned in my other post or Carsten Dominik
et al's HP48/49 Entry Database 
( <url> ) for more information on
palparse.
-
Jonathan Busby - <email_address>
Remove the random permutation of "NOSPAM" from my e-mail address
before replying."
    @kickahaSiPAriuM: "Thx Jonathan to spending your time answering me.
I had still thinked of the "classic" ERRSET-ERRTRAP sequence, and I was
convincted that I used it last night, noticing that it didn't work properly.
Now retrying it I noticed that all goes as I expected... what can I say... I
think that programming asleep it's not good as posting on ng (as you said)
:o)
Thx anyway for your time. At least you pointed out to me how to perform an
error trapping based on LAMs used as flags; I never thinked to it before, I
just used the error numbers.
Thx again,
Kickaha
Per rispondere rimuovere il SiPAriuM
To reply remove the SiPAriuM"
    @jdb: "On Fri, 7 Nov 2003 21:09:38 +0100, "Kickaha"
<quote>
Well, if you are trapping on a block with multiple error sources, then
you can use error numbers if the sets of possible errors generated by
each source are disjoint. If they're not, as was the case in my
example, then you'd have ambiguity. 
	Anyway, I used a flag because I thought in my lethargic
delirium it would be more "elegant" to use one error block, but it
turns out that simple separate error blocks for each source will
usually be smaller.
-
Jonathan Busby - <email_address>
Remove the random permutation of "NOSPAM" from my e-mail address
before replying."
{'source': 'USENET', 'other_information': '{"reply_count": 5, "forum_name": "comp.sys.hp48.20140922.mbox"}', 'file': 'data/output/usenet-comp.sys.parquet'}