Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Save unlimited command-line entries [HP49 version]

443 views
Skip to first unread message

John H Meyers

unread,
Jan 21, 2000, 3:00:00 AM1/21/00
to
Subject: Save unlimited command-line entries [HP49 version]

The CMD function on the keyboard saves four previous entries for you
(or fewer than four, if you re-enter any of them) -- if you want to
re-enter anything more than four entries ago, you must re-type it,
unless you rely on the stack to save entries in Algebraic mode,
and refrain from clearing the stack, and are happy with the
history list, which you can't search in quite the same
convenient way that you can search a "choose" list.

How would you like to save the last 100 (or more) entries instead,
and be able to find them by searching a convenient "choose" list?

Also: no duplications, no loss when the stack is cleared,
and no loss even from ON+C ?

If this sounds useful, try the package below; the "alphaENTER"
program saves your entries, and the "CMDS" program lets you
pick one to re-use; assign the latter to a key -- I prefer HIST,
for one-key immediate access (I use up-arrow instead for HIST),
but CMD is another logical alternative, or any other key
which doesn't ever seem to get fingerprints on it :)

E.g. to assign the HIST key: 'CMDS' 41.1 ASN
CMD key: 'CMDS' 41.2 ASN
APPS key: 'CMDS' 21.1 ASN etc.

Execute CMDS once to get started, and then all future entries
will be automatically saved (as long as "user mode" remains on).

The HP48 version of this package was originally posted here:
<http://www.deja.com/getdoc.xp?AN=376250114&fmt=text>
You can add the new "no duplication" feature to the HP48 version
by inserting the extra steps you may find in the HP49 version
(below), where it says "repeated entry moves to top"
(do not copy the HP49 syseval addresses, however).


This works completely transparently in HP48/49 RPN mode,
but unavoidably not quite so in HP49 Algebraic mode;
for a further discussion about HP49 Algebraic mode
(and its interaction with any "Vectored Enter" program),
read the lengthier follow-up which I will post later.

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

To install: Download, run, and then discard the whole file
which follows (or manually enter each program as shown)

Please be sure to attach library 256 before downloading!


%%HP: T(3)F(.); @ \-> is right-arrow, \Ga is Greek alpha, etc.
@ Save unlimited command line entries, HP49G version

@ Programs supplied here:
@ AlphaENTER Saves your entries
@ CMDS Choose and re-use a previous entry (assign to key)
@ PGLC Purge all saved entries
@ EDLC Edit a stack object and save its text
@ Hidden Required for access to Hidden Directory

@ To install: Download, run, and then discard this whole file
@ (or manually enter each program as shown)
@ HP49 library 256 must be attached before downloading.

\<< \->STR -95. FC? { DUP } @ RPL mode?
@ In algebraic mode (as of rom 1.17-6) the calc will leave the
@ original command line string on the stack; we can't turn this
@ off, nor can we replace it with the normal "colon" line
@ (we could generate the "colon" line instead, and leave you to
@ press ENTER again to evaluate it, but that would be even uglier).
@ When you re-use a previous command, only the result will appear,
@ but this function itself is a substitute for the "stack history,"
@ so you may prefer to see more of your results on the stack itself.
{ "`" SWAP OVER "" SREPL DROP SWAP DUP2 + + } IFTE @ back quote
:palparse: #2EF62h SYSEVAL :TRUE: #3A81h SYSEVAL SAME
\<< 'LastCmds'
{
ROT OVER VTYPE 0. < { { } } { OVER RCL } IFTE
DUP2 SWAP POS DUP @ repeated entry moves to top
{ SWAP LIST\-> 1. - DUPDUP 4. + ROLL - 3. + ROLL DROP \->LIST }
{ DROP } IFTE + 1. OVER SIZE 100. @ max # of entries to keep
MIN SUB SWAP STO
} Hidden EVAL :EVAL: #6F8Eh SYSEVAL \>> @ uses 'Hidden' program
{ :ParseFail: #2EF6Eh SYSEVAL } IFTE
\>> '\GaENTER' STO @ 'AlphaENTER' [do not change this name]

\<< -55. CF -62. SF -63. SF 'LastCmds' "" OVER + SWAP
IFERR Hidden RCL THEN DROP2 "No Saved Commands" DOERR ELSE 1.
CHOOSE { "" SWAP IFERR INPUT THEN DROP2 ELSE \GaENTER @ AlphaENTER
END } IFT END \>> 'CMDS' STO @ assign to a key, e.g. CMD or HIST

\<< 'LastCmds' Hidden PURGE \>> 'PGLC' STO @ purge all saved entries

\<< -55. CF DUPDUP TYPE 6. == { RCL } IFT \-> ~n ~o
\<< "" ~o :EDITDECOMP$: #25ECEh SYSEVAL
IFERR INPUT THEN DROP2 ~n ELSE \GaENTER @ AlphaENTER
~n TYPE 6. == { ~n STO } IFT END ~o DROP
\>> \>> 'EDLC' STO @ edit stack object, 'name' edits the variable

@ Next line uses a command from library 256
"D9D201DF603C073B2130" H\-> 'Hidden' STO @ :: COLA WithHidden ;

@ End of downloadable HP49G file


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


Sent via Deja.com http://www.deja.com/
Before you buy.

John H Meyers

unread,
Jan 21, 2000, 3:00:00 AM1/21/00
to
This follow-up is about what the HP49 currently does in Algebraic
mode when a "Vectored Enter" (or "Custom Enter") program
is supplied by the user (if you are an "RPL-person" then
this may not concern you, and could even be boring :)

A Vectored Enter program "intercepts" each edited command line
and decides what to do with it; typical uses include "tracing"
(sending a record of calculations to a printer, say),
or modifying the input (automatically inserting "#"
for entering binary numbers, say), or for saving
a longer history of entries, as we are doing here
(in the just-posted program package).

In all such applications, it would be desirable if the
"Vectored Enter" program could function completely transparently,
which means that the calculator should behave exactly
as it normally does, save for the added feature which
the "intercept" program is performing for you.

Until very recently (rom version 1.17-4 or so), there never
was any Vectored Enter program working with HP49 Algebraic mode,
because the calc forgot to leave the edited string on the stack
for such a program to retrieve; so, the recent bug fix was the
first opportunity to ever try such a program in Algebraic mode.

IMHO, the way it turns out to be implemented now is slightly flawed,
in that it is impossible to achieve the "transparent" results
which we might like. In normal algebraic mode, each user entry
generates exactly *two* new results on the stack: first you get
a "tagged" (and unevaluated) compilation of what you entered
(the "colon" line) and then you get the calculated result.

If a Vectored Enter program is active, however, the calc
offers no way for the program to decide what the first of these
lines should say (or if it should even appear at all); rather,
it always puts a copy of the edited string on the stack instead,
and allows the user program to influence or deliver
only the second (calculated results) line --
multiple results left on the stack are only collected
into a single list in algebraic mode, so you can't
deliver more than one line of results, even if you try.

For example, if I type 3+4 and then press Enter,
the normal results would appear like this:

: 3+4
7

If there exists any "intercepting" user program, however,
you will instead be forced to settle for this:

"3+4"
7

Unfortunately, you can not re-execute (or even re-use)
this string, which replaces the "colon line"; if the
reason for even having the user intercept program
is to modify the original input, say to insert "#"
in front of binary input for you, you won't even
see the inserted "#" because the command string
left on the stack is what was first typed in,
not what the user intercept program changed it to.

If you use ANS(n) in any subsequent input, the strings
left on the stack will count as if they were previous *results*,
rather than previous input lines (which are not counted).

If you select a previous input line from a saved list
(as we are doing here), edit and re-enter it, there is
no way to supply a new "command/colon" line to go with it,
as you could do with a line selected from the built-in CMD list
(if it were not that CMD can hold only four previous inputs);
you will notice that you get the results, but no "command line"

If you actually want to *suppress* the command lines
(and thus let you see more stack results at one time),
as some recent posted questions may have suggested,
there is no way to do it, except as indicated in the
preceding paragraph, where you can not help but suppress them.

Do we have a long enough list of minor flaws yet?

Now, I know that there is a rationale to returning the
command strings, but I imagine that it might be based on
the thought that *something* should be returned, and that it should
somehow resemble what usually happens by default, but since the calc
can't guess what the user-supplied program is going to do, choosing
the unprocessed string as the thing to be returned sounds logical,
even though in practical situations above it does not work out well.

Remember, however, that no one ever tried it out before
(because it never worked in any previous rom versions), so it's
a brand new thing to be discovered when put into actual practice.

If the user supplies an "intercept" program, however, it means that
the user wants to customize something for himself; why not, then,
give him the opportunity to define what he wants to return as the
independent "command line" as well? (or even let him suppress it,
if that's what he wants). How to offer such a capability?
It might be a special command which works only in algebraic mode
(as NSUB and ENDSUB work only within a DOSUBS environment), or it
might be a "reserved" local variable name in which to store something
(where some particular value could represent "return nothing"), etc.

If this were available, then it would become possible to implement
this "old" HP48 feature so as to remain transparent in Algebraic
mode on the HP49, which would be nicer; it would also permit users
(or third-party application developers) to choose whether/when
to have these extra items appear, as they deem appropriate,
instead of being constrained by a rigid and unadjustable behavior.
The default could still be to return the same string as now,
so adding any extra ability need not inconvenience
anyone who is satisfied with the existing behavior.

This whole issue is no doubt of very low priority, inasmuch as
the main features of the HP49 are its CAS and MK3, but all the
extra contributed software and the features it adds to what
came "out of the box" is historically of some help in adding
to the market for this type of product, so if it isn't
too difficult a thing to do what is suggested above,
and if HP's current outlook and policy permit
(and if the developers want to oblige), then it would be
one more nicer, traditional (and more elegant) kind of feature,
of the sort that sets HP's calcs apart from the rest of the pack.

So, is someone surveying how many new buyers have
decided to use the Algebraic mode vs. RPN mode, anyway?
Hopefully it follows the predictions of the focus groups
and educators who had a chance to give input,
and maybe it doesn't yet eliminate RPN as a contender
("You should'a looked out for me, Charlie...")

frank.alves

unread,
May 31, 2012, 1:25:35 PM5/31/12
to
> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.


Great program!

Is there any way to create a shortcut to use from another directory?

Thank you.

Wes

unread,
Jun 2, 2012, 4:06:15 AM6/2/12
to
> Save unlimited command-line entries

John, this is really sweet. Thanks for posting it. I remember some
years ago you posted a similar (same?) program, but I never got around
to trying it out. This time I did and it's a keeper.

Thanks,
-wes

John H Meyers

unread,
Jun 2, 2012, 9:42:58 AM6/2/12
to
On 5/31/2012 12:25 PM, frank.alves wrote:

[apparently I must have paid someone
to "tile" an entire wall with identical copies of my long post(s?),
just as they do in big "election years" like this one in USA :]

> Is there any way to create a shortcut to use from another directory?

Any program stored in HOME can be invoked by name from any directory,
provided the program name is not re-used
for anything different in any lower directory,
so you could store all the individual programs into HOME.

You may have some particular directory contain
a different 'AlphaENTER' program for some other purpose,
which will be in effect instead,
when the lower directory is your current directory.

This can not be used as a "Library,"
because the 'AlphaENTER' program can only be stored in a user variable,
as it is searched for and invoked by name from the System Outer Loop.

[r->] [OFF]

John H Meyers

unread,
Jun 2, 2012, 9:47:48 AM6/2/12
to
On 6/2/2012 3:06 AM, Wes wrote:

> Thanks for posting it.

I didn't -- apparently my publicity agent
(whom I never even knew I had) did it for me,
and I hope I don't receive a bill for all that ad space :)

[r->] [OFF]
0 new messages