From: jhmeyers@miu.edu (John H Meyers)
Newsgroups: comp.sys.hp48
Subject: A new DISP (Text in graphics mode on HP48G)
Date: 11 Oct 1998 00:09:20 GMT
Organization: MIU Computer Services,  Fairfield, IA 52557.  Not Approved.
Lines: 86
Message-ID: <6vosvg$a71$2@news.iastate.edu>
References: <6vnu5v$ggu$1@news1.iamerica.net>
Reply-To: jhmeyers@miu.edu
NNTP-Posting-Host: vax1.mum.edu
Xref: republic.btigate.com comp.sys.hp48:17130

In article <6vnu5v$ggu$1@news1.iamerica.net>,
Brad Dodson <bdodson@dodson-hydro.com> writes:

> I was wondering if there is a way to display text on your picture
> (esp. through a program) on my HP48G

  Object n \->GROB can be used to make graphic objects which
  represent the argument object; if the argument object is a string,
  then you get a graphic containing text, which you can then
  REPLace (or G[X]OR) on the PICT grob.

  The argument n is 1, 2, or 3, according as you want text to be
  converted using built-in small, medium, or large font.

  N may also be zero, which produces an "Equation-Writer" grob
  if the object is algebraic (or has units);
  otherwise n=0 defaults to n=3.

However, doing the above is slow, and is a pain in the ****;
therefore, you might also use one of the programs below,
which are alternatives for the ordinary DISP command, where
"string" n DISP displays the object (or string) on line n
of the stack (text) screen, where n is normally restricted
to values 1 through 7 (line 8 being where the menu appears).

These alternate programs display the object on whichever
screen (text or graphics) is current, and allow the value of n
to be up to 8, if the screen is currently large enough.

Note that DISP always clears a whole row when it displays
anything on that row, so do not expect quite as nice a result
if you use it in the middle of a nice picture or graph.

Both a User-RPL and a SysRPL version are supplied here;
basically, these are just the same as the internal DISP,
except for just a little tweak:


%%HP: T(3); @ DISPF - DISP on HARDBUFF, using current height

\<< DUP R\->B DROP 0 RND @ Requires real number
  SWAP \->STR SWAP 1 MAX #12635h SYSEVAL @ HARDBUFF
  SIZE SWAP DROP 8 / B\->R DUP ROT MIN SWAP OVER - 1 +
  #194F7h SYSEVAL #3A4CEh SYSEVAL \>> @ COERCE2 Disp5x7
@ 116.5 bytes (on stack), #AF74h


SysRPL version:

%%HP: T(3); @ DISPF - DISP on HARDBUFF, using current height
C$ $
::
 CK2NOLASTWD
 CK&DISPATCH1
 ONE
 ::
  SWAP
  DO>STR
  SWAP
  COERCE
  ONE #MAX ( Was: DUP#0=IT #1+ )
  HARDBUFF GROBDIM DROP #2/ #2/ #2/ ( Was: SEVEN )
  DUPROT
  #MIN
  SWAPOVER#-
  #1+
  Disp5x7
 ;
; ( 60 bytes, #86CAh )


Compiled version of the SysRPL, in ASC format (see the FAQ):

%%HP: T(3); @ DISPF - DISP on HARDBUFF, using current height
"D9D20D8A812BF819FF30D9D20322308804132230AEC819FF306C426536218750
544230E8E30E8E30E8E301BF26AB4264A736FED30EC4A3B2130B2130AC68"


Next time I will follow-up with some additional programs
you can use to always have an eight-line screen to play with,
but my keystroke quota has been used up for the nonce :)

No doubt you will find the above inDISPensible, I'm sure :)

-----------------------------------------------------------
With best wishes from:   John H Meyers   <jhmeyers@mum.edu>