home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!chx400!ugun2b!ugcmu!cohen
- Newsgroups: comp.sys.hp48
- Subject: ParOuterLoop'news
- Message-ID: <1992Aug17.113027.201@cmu.unige.ch>
- From: cohen@cmu.unige.ch
- Date: 17 Aug 92 11:30:27 +0200
- Organization: University of Geneva, Switzerland
- Lines: 105
-
- Concerning the ParOuterLoop which seems to give some difficulties....
-
- With the help of William j. Levenson and Mika Heiskanen (I thank them
- very much for their precious remarks), I post some interesting
- discovers (Sorry if they are already found out!)
-
- First of all, the ParOuterLoop modifies the temporary environment
- as the following example shows:
-
- BEGIN_RPL example.s
- INCLUDE KEYDEFS.H
- ASSEMBLE
- NIBASC /HPHP48-E/
- RPL
- :: CK0
- THREE TWO ONE
- { NULLLAM NULLLAM NULLLAM } BIND ( { 1 2 3 })
- FALSE
- { LAM Exit } BIND ( *Bind POL exit flag* )
- ' NOP ( *No display action* )
- ' :: ( *Hard key handler* )
- kpNoShift #=casedrop
- ::
- kcOn ?CaseKeyDef
- :: TakeOver
- TRUE ' LAM Exit STO ;
- ;
- 2DROP 'DoBadKeyT
- ;
- TrueTrue ( *Key control flags* )
- NULL{} ( *No softkeys here* )
- ONEFALSE ( *1st row, no suspend* )
- ' LAM Exit ( *App exit condition* )
- ' ERRJMP ( *Error handler* )
- ParOuterLoop ( *Run the ParOuterLoop* )
-
- 1GETLAM 2GETLAM 3GETLAM 4GETLAM 5GETLAM
- ABND
- ;
- END_RPL
-
- The resulting stack is :
- :5: External Stand for
- :4: External the last flags.
- :3: <3d>
- :2: <2d>
- :1: <1d>
-
- So, if you still want to use your temp. variables after
- the ParOuterLoop, you'll have to write N+2GETLAM instead of NGETLAM
- unless you use named temporary variable like { LAM name }.(This tip
- comes from a recent mail from Mika Heiskanen). Secondly, you can't
- use 3GETLAM to get ONE inside the loop (try it in the the example above).
- That must be why it is mentioned in RPLMAN to use named temp. var. inside
- the ParOuterLoop.
-
- But what is strange is that the ParOuterLoop should restore the old
- temp. env. because of the POLRestoreUI at the end as it is
- described in RPLMAN.DOC:
- ------------------------
- ("POLSaveUI")
- Save the system or current application's
- user interface
-
- If error in
-
- ("POLSetUI")
- Set the new application's user interface
-
- ("POLKeyUI")
- While "ExitCond" evaluates to FALSE {
- Evaluate "AppDisplay"
- If error in
- Read and evaluate a key
- Then
- Evaluate "AppError"
- }
-
- Then
-
- Restore the saved user interface and
- ERRJMP
-
- ("POLRestoreUI")
- Restore the saved user interface
- ------------------------------
- So, the question is how the POLRestoreUI command works ?
- If anyone has an explanation, please post it...
-
- One more thing, I found the bug in my rpl program called 'Scrn'
- posted a few days ago : in fact, it was just the sub$ command
- which was applied to an object that wasn't necessary a string!
- So, the moral is if you can't do a LASTSTACK after the program has run
- (the calc is stuck), you probably put bad arguments in the stack.
- A retenir!!!
- ( I 'll post a new version of Scrn with some improvements in the
- next days.)
-
- For any commments or remarks, please mail to:
-
- cohen@cmu.unige.ch
- Daniel COHEN-LAROQUE
-
-
-
-