[comp.sys.handhelds] HP-48: Search path, backups, port 0 objects

edp@jareth.enet.dec.com (Always mount a scratch monkey.) (03/26/90)

There have been a couple of requests for a "search path" on the HP-48 so that
variables the user wishes to be globally accessible do not have to reside in
the home directory.  Besides using the home directory, this can be accomplished
by putting the variable in port 0 (or 1 or 2).

For example,
	object :0:name STO
will put the object in port 0 with the specified name.  It can be recalled
with :0:name RCL, and it can be evaluated with :0:name EVAL.  This will
work regardless of what the current direct is.  Also, using a name of the
form :&:name will cause a search for the object in port 2, port 1, port 0,
and the home directory.

There are some caveats.  Objects in the ports will not be archived when the
ARCHIVE command is used.  Port objects are more difficult to manipulate --
you cannot store a new value over them without purging the old value first.
In fact, if you have recalled the value to the stack and then try to purge
the old variable, it will fail with an error "Object in use".  It is necessary
to use NEWOB to make the object on the stack a separate copy from the port
object.

Nevertheless, I have put my nightly backup program in port 0.  It runs and
uses the objects in port 0 regardless of what the current path is and without
needing to change the current path.


				-- edp (Eric Postpischil)
				"Always mount a scratch monkey."
				edp@jareth.enet.dec.com