Post Reply 
userRPL / hp 50g, creating grobs from list using the "text" view.
04-18-2017, 06:44 PM
Post: #7
RE: userRPL / hp 50g, creating grobs from list using the "text" view.
(04-18-2017 08:06 AM)pier4r Wrote:  I wonder if the advice was in the user manual but I missed it.

To be honest I don't remember where (or even if) this is documented. Don't feel bad about not seeing it.

(04-18-2017 08:06 AM)pier4r Wrote:  what do you mean with sysRPL ? I mean, since the text mode is "there" in the calculator, I thought a solution was readily available. (as it seems, thanks to flag -70)

I was mainly referring to the specific case of converting a list to a "wrapped" GROB. The functions exist to do this in userRPL, but the code to do it in sysRPL is fairly straightforward and compact because of the existence of a couple of commands which are not available in userRPL:
Code:
::
   CK2NOLASTWD             ( must have 2 arguments on stack )

   CK&DISPATCH1            ( will convert zints to reals if needed )
   LISTREAL ::             ( SL2: LIST, SL1: REAL )
      COERCE               ( convert real to system binary integer )
      !DcompWidth          ( set column wrap breakpoint )
      FLASHPTR FSTR4       ( convert list to string, insert CRs as appropriate )
      $>GROBCR             ( convert string to GROB, respect CRs )
   ;
;

The above 7-step sysRPL program takes a list in stack level 2, and a number in stack level 1 that represents the targeted "wrap" column. The result is the GROB representing that list in column-wrapped form using the "large" font. It even validates that the arguments are present and of the proper type, raising an error if not.

I'm not trying to suggest that you can't do similar things with userRPL, but merely that this particular function was a good example of when sysRPL can be very useful.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: userRPL / hp 50g, creating grobs from list using the "text" view. - DavidM - 04-18-2017 06:44 PM



User(s) browsing this thread: 1 Guest(s)