So, would you like to have your HP48 remember your last thirty
entries also? Or perhaps fifty? (Well, don't go overboard;
even a big memory is not infinite :)
This is in fact easily done; see an earlier post:
"Vectored/custom ENTER"... 1998/07/25
<http://www.dejanews.com/getdoc.xp?AN=374796851>
Erratum:
The "Kermit header" might better have started with %%HP: T(3)F(.);
(including the "period as fraction mark"), to make downloading
successful on any calcs which are normally set the other way.
In case your memory appetite goes on a binge, or you need to
"shred" the evidence of what you were typing, a "purge" function
is also provided, to let you free the collection of saved items.
I need to "free" a few pounds myself,
but I can't seem to find the button :)
-----------------------------------------------------------
With best wishes from: John H Meyers <jhme...@mum.edu>
When you use the "Vectored/Custom Enter" feature in the HP48
(which turns all typed input over to you to deal with as you wish,
instead of automatically parsing and executing it), the syntax of
what you type is not checked; therefore I have added the customary
syntax checking to the program below.
The "Custom Enter" option also only captures "new" typed input;
it does not intercept the contents of the command line when you
edit existing objects, as does the built-in "Last Commands" function.
In case there is some reason you might also want to save the command
lines when you edit existing objects, another program has been included;
however, the built-in Last Commands feature also keeps saving all
entries for you anyway, although still limited to the last four entries.
Only SX/GX "supported" system entry points are used, but a "choose"
function (G/GX command) is necessary for "Last Command" selection.
-----------------------------------------------------------
With best wishes from: John H Meyers <jhme...@mum.edu>
-----------------------------------------------------------
%%HP: T(3)F(.); @ 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 complete a new entry 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)
@ #64037h SYSEVAL is 'WithHidden', which executes the next
@ *following* object (command) in the "hidden" directory,
@ which is where the list of saved editing buffers is kept.
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 @ Assign CMD key [GX]
\<< \<< CMDS \>> 52.3 ASN \>>
PgLC @ Purge all saved commands
\<< 'LastCmds' #6408Ch SYSEVAL \>> @ PuHiddenVar
\GaENTER @ AlphaENTER - this name must not be changed
\<< \->STR DUP #238A4h SYSEVAL { #5380Eh SYSEVAL } EVAL @ palparse
\<< 'LastCmds' { ROT OVER VTYPE 0 < { { } } { OVER RCL } IFTE
+ 1 OVER SIZE 30 MIN SUB @ <== Adjust here
SWAP STO } #64037h SYSEVAL EVAL #6F8Eh SYSEVAL @ internal eval
\>> { #40B2Eh SYSEVAL } IFTE @ ParseFail
\>> @ Adjust constant "30" for maximum number of commands to save.
EO @ EDIT replacement, to save edited string in 'LastCmds' also
@ 'name' edits variable contents; original object -> Last Args
\<< -55 CF DUP DUP TYPE 6 == { RCL } IFT \-> ~n ~o
\<< "" ~o #15A0Eh SYSEVAL { V } + IFERR INPUT THEN DROP2 ~n
ELSE \GaENTER ~n TYPE 6 == { ~n STO } IFT END ~o DROP \>> \>>
END @ Directory ends