Time warp – more than 15 years since the first thread, it still looks
very useful to me. Of course I need to add my own equations. Also
it looks like a good opportunity to brush up on user-RPL....
interfacing with the program as a user and then inspecting the RPL
code behind it.
QUESTIONS:
1 – Forum etiquette question for future reference - Should I have
posted followup questions onto the decade+ old thread or is it more
appropriate to generate a new thread as I did here?
2 – I’d like to clarify the example directory/equation structure
posted in the last thread. Is this:
2A – Just example directory structure which cannot be auto-loaded into
memory in it’s present form
2B – User RPL that can somehow be automatically loaded to create the
directory structures.
Answer 2A doesn’t make sense because there are intermingled comment
sign @ as if it was code. Also at the end a stop command “Stop { } @
Stops menu listing in this directory (even without hider). “ which
makes no sense to me if this is just an example.
Answer 2B doens’t work because the code doesn’t run and doesn’t match
syntax for any DIR command.
Obviously I am missing some part of the picture. Can you lessen my
confusion?
I would like to build my equation set on PC and keep the master
version on PC. So I envision it would be helpful to have a
programmatic way to load the directory structure with equations. For
readability of original code it makes sense to have name before
definition. So I created SSTO swap/sto command to store variables when
name entered before variable. The way I envision to store my
equations on PC for programmatic loading is as follows:
Below is the format that I'm thinking about building my libraries.
Feel free to comment if it appears I'm wandering off in a meaningless
direction:
=========CODE CUT/PASTED FROM HPUSEREDIT===========
« @ PROGRAM TO LOAD DIRECTORY STRUCTURE AND EQUATIONS PROGRAMMATICALLY
@ Create subroutine SSTO (in home) which swaps and stores
HOME « SWAP STO » 'SSTO' STO
@ Create dir EQLIB as subdir to home
HOME @ Navigate to home
'EQLIB' CRDIR
@ Create dir Sample1 as subdirctory to EQLIB
EQLIB @ navigate to directory EQLIB
'Sample1' CRDIR
@ Create entries
Sample1 @ navigate to directory Sample1
@ Note - we don't need single quotes around var names since they don't
already exist
Trip 'Dist=Rate*Time' SSTO @ Uses standard solver
Lamp { 'V=I*R' 'W=V^2/R' } SSTO @ Uses Multiple-Equation solver
Prog « P Q * 1 - » SSTO @ Programs may be used as equations
@ Optional units for Trip:
TripINIT { 0_mi Dist 0_mph Rate 0_h Time } SSTO @ Value VarName ...
@ Optional units for Lamp:
LampINIT { 0_V V 0_W W 0_A I 0_\GW R } SSTO @ Special char. for Ohms
@ Optional variable descriptions for Lamp:
LampVARS { "V: Voltage" "W: Wattage" "I: Current" "R: Resistance" }
SSTO
@ Optional Multi-equation title and menu labels:
LampMITM { "Lamp" { V W "" I R } } SSTO
@ Clean up (remove) SSTO
HOME 'SSTO' PURGE »
============ END OF CODE========================
On Feb 5, 1:34 pm, electricpete <electricpe...@gmail.com> wrote:
> User Equation Library Follow-up questions
> Also at the end a stop command “Stop { } @
> Stops menu listing in this directory (even without hider). “ which
> makes no sense to me if this is just an example.
Ah,, the light is starting to come on. STOP is a name to be used for
another variable, which will contain { }. It is not associated with
the equations, but is part of the interface/program... as are the
remainder of the variables listed after STOP. Now I feel reasonably
confident the answer is 2A (example directory structure). The comment
symbol @ is just a familiar symbol to set off extra comments, even
though it doesn't seem to be a calculator-executable program listing.
> Ah,, the light is starting to come on. STOP is a name to be used for
> another variable, which will contain { }. It is not associated with
> the equations, but is part of the interface/program... as are the
> remainder of the variables listed after STOP. Now I feel reasonably
> confident the answer is 2A (example directory structure). The comment
> symbol @ is just a familiar symbol to set off extra comments, even
> though it doesn't seem to be a calculator-executable program listing.
I bet it is loadable and executable -- don't the postings say so?
Type or paste the next two lines into your calculator or emulator,
typing a "newline" between lines (rather than pressing ENTER between the lines):
1 @ 2 @ 3 @ 4
567
What results?
Now you know all about unquoted @ in either command lines
or ascii text transferred into the calculator,
without even having to read a manual :)
I am not surprised that @ can be intermixed with code to embed
comments in it. In fact, the reason I first mentioned the @ was that
it lead me to believe this was code. (I stated in my first post the @
was one of the things that made me doubt scenario 2 = example
directory structure not loadable).
Then in my 2nd post, I changed my mind for other reasons and
rationalized the @ must be just a notation (rather than a comment in
executable code)
I’d like to discuss those other reasons further. Here are those other
reasons that lead me to doubt it was loadable code:
1 – I can’t get it to do anything other than load as text.
2 – It doesn’t match any syntax I can find.
At the end of this message I have cut/pasted an excerpt which
represent the first several lines, associated with the equation
variables. It seems to me this consists entirely of identifiers
(Sample, Trip, Lamp, Prog etc) and data (‘Dist=Rate*Time’ etc). I see
no commands that I recognize (like STO). I also see “DIR” which is
not listed in the HP48 Advanced User’s Reference command reference
section (alphabetic listing goes from DiffEq to Disp without any DIR
in between).
Without any command, I am not understanding how we can do anything
with this other than load it onto the stack as a string. Am I
missing something?
Thanks again.
========== EXCERPT CUT/PASTED BELOW=======
DIR @ Directory: name <object> name <object> ...
Sample @ Sample sub-directory of equations:
DIR
@ Deeper sub-directories are permitted, if desired.
Trip 'Dist=Rate*Time' @ Uses standard solver
Lamp { 'V=I*R' 'W=V^2/R' } @ Uses Multiple-Equation solver
Prog \<< P Q * 1 - \>> @ Programs may be used as equations
Stop { } @ Stops menu listing when encountered
@ Optional units for Trip:
TripINIT { 0_mi Dist 0_mph Rate 0_h Time } @ Value VarName ...
@ Optional units for Lamp:
LampINIT { 0_V V 0_W W 0_A I 0_\GW R } @ Special char. for Ohms
@ Optional variable descriptions for Lamp:
LampVARS { "V: Voltage" "W: Wattage" "I: Current" "R:
Resistance" }
@ Optional Multi-equation title and menu labels:
LampMITM { "Lamp" { V W "" I R } }
@ An optional picture may also be stored in LampPICT, etc.
END
=================================
On Feb 7, 10:30 pm, electricpete <electricpe...@gmail.com> wrote:
> Without any command, I am not understanding how we can do anything
> with this other than load it onto the stack as a string. Am I
> missing something?
> Thanks again.
DIR denotes a directory. Copy and then paste the entire code listed in
"User Equation Library in User-RPL" onto the stack. Run the program
IN that is listed in "Ascii Import/Export for SD card and Emulator".
Place a name on the stack (e.g. 'EQLIB') and then press the STO Key.
This effectively creates a directory populated with the different
programs, variables, etc.
The code is for the HP48G/GX series. It uses SYSEVALS that cause my
50g to crash.
That comment explains the format of a directory in UserRPL!
What more could you want?
With a well written [HP48G series] User's Guide
and a calculator to experiment with,
I'm sure you can now manage to learn and use it,
by actually doing things with it.
Rome wasn't built in one day,
and even Sesame Street takes time to get all the way from A to Z,
but every child who gets involved inevitably learns it all.
> That comment explains the format of a directory in UserRPL!
> What more could you want?
> With a well written [HP48G series] User's Guide
> and a calculator to experiment with,
> I'm sure you can now manage to learn and use it,
> by actually doing things with it.
> Rome wasn't built in one day,
> and even Sesame Street takes time to get all the way from A to Z,
> but every child who gets involved inevitably learns it all.
> [r->] [OFF]
Thanks John. Your instructions were well-written and probably for most
would be self-explanatory.
I actually did read/understand the comment you mentioned (DIR @
Directory: name<object> name<object> ... ) and understood prety
well that I was looking at a directory structure which included
variable names followed by associated objects.
The particular statement that never sunk in for me initially was “@
Store this complete directory in HOME, perhaps named 'EQLIB'
What you meant that I eventually figured out was that after entering
this entire structure, we should simply enter ‘EQLIBNAME’ STO
I am familiar with STO for simple objects like values and for compound
objects: algebraics, lists, programs.
It never dawned on me this whole directory was a single (compound)
object with delimiters DIR...END and therefore could be stored in the
same way thereby creating all the subdirectories.
In my defense, after skimming the QUICK START GUIDE, the USERS’ GUIDE
and even the ADVANCED USER’S REFERENCE (quite a few pages among those
documents), I don’t see any reference to creating or storing more
than one variable at a time. I don’t see any reference to a DIR.. END
delimiter structure. I don’t see any reference to a directory as an
object, other than the fact that directory happens to be listed as one
of the possible outputs of the TYPE command for objects. If I’m
mistaken on that , please feel free to correct me. (I noticed
someone in the thread linked by NATE referred to this features as
“well documented”, which struck me as very odd).
Anyway, I’m not complaining. The lesson for me is that we get a lot
of extra capabilities in the HP48 even beyond those described in the
user manuals. That’s not a negative, that’s a positive (like an
unexpected gift).
It makes the generous contributions of knowledgeable folks like
yourself (John) and others here on the forum even more valuable.
And thanks for creating and posting your user-RPL equation library
which made it possible for me to begin this particular voyage of
discovery. I’m sure there will be more.
> What you meant that I eventually figured out was that after entering
> this entire structure, we should simply enter ‘EQLIBNAME’ STO
It's interesting that the fundamental equations of classical physics
(of mechanics and electromagnetism, anyway)
remain satisfied if 't' (time) is replaced everywhere by '-t'
causing much hand-wringing over why, then, it seems difficult
to throw the pieces of a smashed flower pot back together again
to restore the original pot :)
At any rate, your experience of the present
might be what influenced me to have already,
in the past, decided to explicitly include 'something' STO
in nearly everything I've since posted -- thank you for
that suggestion in the present,
which may have influenced much of the entire past,
except not quite that far back :)
> It never dawned on me this whole directory was a single (compound)
> object with delimiters DIR...END and therefore could be stored in the
> same way thereby creating all the subdirectories.
Yes, indeed -- if you had first created directories within directories,
and then recalled them to the stack,
you would already have been familiar with the DIR ... END thing,
much as I learned to take various things (like watches and cameras) apart,
as a child, often to the dismay of the former owners of these things,
before I learned how to re-assemble them, which also presents the same sort of
mystery as to why one of these activities is often much easier than the other :)
I once listened to physicist Richard Feynman describe atomic particle research
as more or less like smashing watches together to try to find out
what they are made of, by catching parts flying out from the result;
Feynman received a Nobel prize in Physics for some of that,
while all I got was a handful of springs, pins, and gears :)