From: jhmeyers@miu.edu (John H Meyers)
Newsgroups: comp.sys.hp48
Subject: Vectored/custom ENTER and Lib->variable (Just a few questions)
Date: 25 Jul 1998 13:49:35 GMT
Organization: MIU Computer Services,  Fairfield, IA 52557.  Not Approved.
Lines: 123
Message-ID: <6pcnpf$709$3@news.iastate.edu>
References: <om26762oo@germanynet.de> <6p3n4u$j6h$1@ul3.satlink.com>,<om26762oo@germanynet.de>
Reply-To: jhmeyers@miu.edu
NNTP-Posting-Host: vax1.mum.edu
Xref: republic.btigate.com comp.sys.hp48:13725

On Wed, 22 Jul 1998 00:45:31 -0300,
"Francisco Hidalgo Sol" <fhs@satlink.com> wrote:

> What's the meaning of the flag -63 "Custom ENTER"?

  It is described in the FAQ (currently near section 8.12),
  and also in the AUR, where only superficial uses are discussed;
  if you set that flag (and "user mode" at the same time), nothing
  special will happen, until you also create specially-named
  variables to which the HP48 will turn over the pre-processing
  and post-processing of the edited command-line buffer.

  Have you ever used the Last Commands feature (right-shift CMD),
  whereby you can recall any of the four command line buffers which
  you most recently edited, and then either submit it again or edit
  it further?  Have you ever wanted to re-use a very recent entry,
  only to find that it had just "scrolled off" that very short list,
  and had to be typed in all over again?  Well, how would you like
  to expand that list of saved editing buffers to as many as you
  want, G/GX memory permitting?  Well, here's a directory containing
  programs which will do this, using "vectored/custom enter":

%%HP: T(3); @ Include this line when using Kermit

@ This set of variables implements a "Last Commands" function,
@ exactly like the built-in function; however, the built-in
@ function saves only the most recent four buffers
@ you have entered, while this function can be set
@ to keep any maximum number of buffers you wish.

@ The G/GX user CHOOSE command is used in these programs;
@ any identical replacement for CHOOSE will work as well.

@ Move these variables into HOME once installed.

@ Press CMDS to activate the function for the first time
@ (ignore any "No Saved Commands" message at this time);
@ after you have edited one or more command lines,
@ press CMDS to select from any previous command lines.
@ To abort editing, you may need to press CANCEL twice.

@ The 'SetLC' program may optionally be used to
@ assign the right-shift CMD key to the CMDS program,
@ replacing the built-in function.

@ 'PgLC' may optionally be used to purge all saved buffers.
@ Warmstarts purge HP48 built-in buffers, but *not* our buffers.

@ Do *not* press the key for the 'AlphaENTER' variable;
@ the HP48 automatically calls this name itself each
@ time you finish editing or entering in the Command Line.

@ Turning off USER mode (left-shift USER) inactivates
@ command saving; saving resumes when user mode is resumed.
@ Any user key assignment for the CMD key also adjusts itself
@ off or on at the same time, reverting to the built-in function.
@ Pressing CMDS always turns USER mode back on.

DIR @ Directory:  name1 object1  name2 object2  ...

@ Note the HEX addresses for SYSEVAL, and make sure they're right!
@ (a memory backup is prudent before running new programs)

@ The system function is 'WithHidden', which executes the next
@ *following* object (command) in the "hidden" directory.

CMDS @ Name this variable as you wish
\<< -55 CF -62 SF -63 SF "" 'LastCmds' IFERR #64037h SYSEVAL
  RCL THEN DROP2 "No Saved Commands" DOERR ELSE 1 CHOOSE
  { "" SWAP IFERR INPUT THEN DROP2 ELSE \GaENTER END } IFT END \>>
@ The Greek alpha character may be typed as alpha right-shift A

SetLC \<< \<< CMDS \>> 52.3 ASN \>> @ Assign CMD key

PgLC @ Purge all saved commands
\<< 'LastCmds' #6408Ch SYSEVAL \>> @ "PuHiddenVar:"

\GaENTER @ AlphaENTER - this name must not be changed
\<< \<< DUP 'LastCmds' SWAP OVER VTYPE 0 < { { } }
  { OVER RCL } IFTE + 1 OVER SIZE 30 MIN SUB @ <== Adjust here
  SWAP STO \>> #64037h SYSEVAL EVAL STR\-> \>>
@ Adjust above constant "30" for maximum number of cmds to save.

END @ Directory ends

--------------------

> Can I save a library that is stored in one port to a variable without
> recalling the library, store it in a variable and then purge the
> library from the port, because I don't have enough memory for that.

  If you are talking about Port 0, it is not normally possible
  without doing the store before the purge, requiring the
  temporary existence of both copies simultaneously;
  attempts to do otherwise result in "Object In Use" error.

  Other ports should be no problem, unless you simply don't have
  enough room for a variable large enough to hold the library,
  because the object in the other port is then not in the same
  128K memory section as main calc memory.  If you have enough
  room for a variable of that size, then you have enough temporary
  memory to copy the variable from the port, and in the next step
  (storing), that temp memory should be convertible to user memory.

  If you are asking this because you want to send the library
  via Kermit or XModem, any library in port 0 or port 1
  (or port 2 if port 1 is empty) can be sent without
  copying it at all; just recall it to the stack,
  then:  \<< \-> x \<< 'x' SEND \>> \>>

  Having copied this library to a computer, you can now
  purge it, then copy it back from the computer :)

  Or having, backed up user memory to the computer,
  you can purge all user directories and variables,
  making plenty of room for the library :)

  If you are thinking of doing this to back up the library
  along with user memory, the best thing is to just have
  the library backed up separately.

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