Path: republic.btigate.com!atl-news-feed1.bbnplanet.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.internetmci.com!128.174.5.49!vixen.cso.uiuc.edu!newsrelay.iastate.edu!news.iastate.edu!vax1.miu.edu!JHMEYERS
From: jhmeyers@miu.edu (John H Meyers)
Newsgroups: comp.sys.hp48
Subject: More User-RPL Port Tools
Date: 13 Jan 1998 18:37:38 GMT
Organization: MIU Computer Services,  Fairfield, IA 52557.  Not Approved.
Lines: 252
Message-ID: <69gc9i$cbh$1@news.iastate.edu>
References: <19980105061801.BAA16922@ladder02.news.aol.com>
Reply-To: jhmeyers@miu.edu
NNTP-Posting-Host: vax1.mum.edu
Xref: republic.btigate.com comp.sys.hp48:5644

In article <19980105061801.BAA16922@ladder02.news.aol.com>,
tqmtom9579@aol.com (Tqmtom9579) writes:

> I would like [ PCT 5.60 to have ]
> the ability to recognize a 1meg RAM card.

While recently wandering through Goodies Disk #11
<http://www.liberty.com/home/joehorn/gd11.zip>
I came across GD#11/utils/FPX.lib, a "File and Port Explorer"
(*shareware*) by Paquot Christophe.  Well, if you have tried PCT,
you will certainly recognize FPX, since it appears to be just about
the same thing, right down to some icons; one of the illustrations
in the accompanying text even references PCT, as you may notice.

My apologies if this is too superficial a comparison;
perhaps this shareware is actually a completely different program,
but by coincidence it looks about the same.

The text says that number keys 0,1,2,... are used to change
the port, but just like PCT, I was not able to change to
a port number greater than 2, except by repeatedly pressing
the "F" menu key (whose label shows the current port #,
which increments each time you press it).

The ->P? key has replaced the ->P1 key, and promises to
be able to let you choose the port to which you will
copy something, but once again, I failed to be able to
copy a backup object to a port number greater than 2.

The above will not bother anyone whose slot 2 card has only
one port, but it is cumbersome for cards of size 256K and up.

Is there any way to move an object between two card ports
(other than 1 & 2) without first transferring it to user memory?

Does TREE.GX work on a GX?
(It seems to crash when I try it, so I use the Variable Browser instead)

My clock also seems to get deranged whenever I try these tools (why?).

It's too bad that the G/GX "Memory Browser" didn't
include port memory locations to begin with, since
this could have given users most of the functionality,
if not the cute graphics and higher speed.

Oh well, this whole situation has sent me back once again
to rely on a collection of simple User-RPL programs
to do the task; it's not graphical, but
it's totally flexible, and it works!

To move or copy anything between user memory and any port,
or between any two ports, or even between any two locations
in user memory, just specify the locations,
and then invoke the appropriate program.

A "location" means one of the following:

  'name'    [in current directory]
  { HOME [dir...] name }        [absolute path]
  { [UPDIR...] [dir...] name }  [relative path]
  :port:id  [library or backup object]
   :&:id    [valid for move/copy source and rcl/del] (searches all ports)
   port     [valid for move/copy destination]

Examples:

  3  :&:1234   PMOV       [move a library to a different port]

  { ..path.. }  :&:EQNS   PCPY  [copy from any port to any directory]

  { HOME MATH }  { HOME STAT PROG }  PMOV  [move between directories]

  { UPDIR }  'name'       [move object to parent directory]

  \<< ... \>>  { HOME MATH PROG }   PSTO  [store anywhere]

  :3:1234  PDEL  [delete a library]

Notes:

o When the move/copy destination is a directory name, directory path,
  or port number, then the source object name is appended to it (i.e.
  the object is stored under the same name in the directory or port);
  this is similar to the action of the G/GX Variable Browser.

  If you want to change the name, simply append it to the path name
  of the destination directory, or use a port-tagged destination name.

o The PDEL command given below, like the G/GX memory browser,
  refrains from allowing user directories to be purged or moved;
  however, you can substitute the commented version of PDEL
  to remove this restriction, if you don't mind losing
  the element of safety which it provides.

o To move entire directories between user memory and port memory,
  see earlier "User-RPL Port Tools" posted on 1998/01/01;
  the method used in that post is completely automatic,
  and does not even require you to select a port.

o To compress entire user directories in-place, see
  "BZDIR improved even further (v 3.2)" posted 1997/11/11
  (a continuation and update of a post from 1997/11/09).

o The argument order for PMOV and PCPY is:  new_location  old_location
  This was chosen to be consistent with REN (rename) from Hack.lib,
  since PMOV is similar to renaming an object.

  If you'd rather have it the opposite way, just insert a SWAP
  at the beginning of the PMOV and PCPY programs (but *not* PADJ).

o When a library is moved/copied to user memory, a lower-case L
  is prefixed to its library number to make a variable name.

o Libraries are detached when moved, and will be re-attached after OFF/ON.

o New directories are not created for you; you must create a directory
  ('name' CRDIR) before attempting to move objects into it.

o Existing objects in user memory can be overwritten without confirmation;
  existing objects in port memory cannot be overwritten unless first purged.

o Libraries can't be copied from ROM cards or write-protected ports
  (other backup objects *can* be copied, however).

o Use the HP48 PVARS command (in the LIBRARY command menu)
  to list the contents and amount of free memory in any port;
  read-only ports return "ROM" instead of free memory.

  Use PMEM (Hack.lib) for free memory in write-protected ports.

o The essential PGTO function uses the G/GX DOSUBS command;
  a DOSUBS program for the S/SX may get posted one of these days,
  but S/SX users are happy with PCT or FPX anyway :)

o Elementary program to list contents of 128K + 1 Meg cards:

  \<< 9 1 FOR n n PVARS SWAP + -1 STEP \>>

  Now press up-arrow to start the Interactive Stack;
  each level N corresponds to Port N, and you see at once
  the amount of memory free in each port.  Use the
  VIEW key to examine the list of items in any port.
  Though horribly non-graphical, it works in a pinch :)

  Quick LIBS list:

  \<< PATH HOME LIBS SWAP EVAL 1 \<< NSUB 3 MOD NOT
    { \->TAG SWAP 1 5 SUB \->TAG } IFT \>> DOSUBS EVAL \>>

  This gives you every library's port-tagged id,
  labeled with the first five characters of its name,
  as it generally appears on the Library menu keys.

  If we could only arrange our own order of library keys,
  then we could put our most-used ones "up front"; well,
  this is actually possible with a custom menu, assigning
  \<< 1234 MENU \>> to each library's key; we can easily
  build the menu from just a list of the library numbers,
  obtaining the names from the numbers (left as an exercise).

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

%%HP: T(3); @ \=/ is "unequal", \-> is right-arrow, etc.

{ @ Start of a list of programs and their names.

@ To store the programs, do HOME OBJ\-> DROP then STO STO ...

@ A "location" is one of the following:
@
@   'name'    [in current directory]
@   { HOME [dir...] name }        [absolute path]
@   { [UPDIR...] [dir...] name }  [relative path]
@   :port:id  [library or backup object]
@    port     [valid for move/copy destination only]

@ Location  ==>  Object   [recall]
\<< PATH SWAP PGTO RCL SWAP EVAL \>> PRCL
@ This generalizes RCL to handle even { UPDIR ... }

@ Object  Location  ==>   [store]
\<< PATH ROT ROT PGTO STO EVAL \>> PSTO
@ This generalizes STO to handle paths.

@ Location  ==>   [evaluate]
\<< PRCL EVAL \>> PEVL

@ To_location  From_location  ==>   [copy]
@ Insert a leading SWAP to reverse argument order.
\<< PADJ PRCL SWAP PSTO \>> PCPY

@ To_location  From_location  ==>   [move]
@ Insert a leading SWAP to reverse argument order.
\<< PADJ DUP PRCL OVER TYPE 12 == { @ Tagged
@ Uncomment just *one* of the { NEWOB } lines below;
@ the SysRPL [ INTEMP? COERCEFLAG ] allows :&:xxxx with ports 0-1:
@   OVER OBJ\-> SWAP DROP { "0" "1" }  SWAP POS { NEWOB } IFT
    #6B3Eh SYSEVAL { #5380Eh SYSEVAL } EVAL NOT { NEWOB } IFT
    @ Non-covered ports require an explicit NEWOB before PURGE
  } IFT ROT ROT PDEL PSTO \>> PMOV

@ Location  ==>   [purge]
\<< PATH SWAP PGTO
  DUP TYPE 12 == { @ Tagged
    DUP DTAG TYPE NOT { PATH OVER HOME DETACH EVAL } IFT @ Library
  } IFT PURGE EVAL \>> PDEL
@ This generalizes PURGE to handle paths and libraries.

@ An alternate version of PDEL allowing user directories to be purged --
@ more convenient, but less safe (like PG):
@ \<< PATH SWAP PGTO
@   DUP TYPE 12 == {
@     DUP DTAG TYPE NOT { PATH OVER HOME DETACH EVAL } IFT PURGE
@   } { IF DUP VTYPD 15 == THEN PGDIR ELSE PURGE END } IFTE EVAL \>> PDEL

@ Location  ==>  { HOME [dir...] name }   [get absolute path]
\<< PATH SWAP PGTO PATH SWAP + SWAP EVAL \>> VPATH

@ Id  ==>  var_type   [restrict VTYPE to the current directory]
@ Avoids problems where higher directory contains variable of same name.
\<< #185C7h SYSEVAL VTYPE \>> VTYPD @ SysRPL entry point "DoHere:"

@ Verify all system addresses carefully, and make a backup before using!

@ Destination  Source  ==>  Adjusted_destination  Source
@ Do not change argument order!
@ If Destination is a user directory or a port number,
@ then append the Source object name; this is
@ similar to the action of the G/GX Variable Browser.
@ E.g. { HOME dir } :&:1234 ==> { HOME dir l1234 } :&:1234
@                3   'PROG' ==> :3:PROG  'PROG'
\<< RCLF ROT ROT STD PATH ROT ROT DUP PGTO DTAG @ Source ==> name
  DUP TYPE NOT { "'l" SWAP + OBJ\-> } IFT @ Library
  4 PICK EVAL ROT DUP DUP TYPE { PGTO } IFT { @ Destination
    { VTYPD 15 == { { } + SWAP + } { SWAP DROP } IFTE } @ DIR?
    0 { DROP \->TAG } @ Port number [append source name]
    12 { ROT DROP2 }  @  :port:id  [discard source name]
    19 { DROP { } + SWAP + } @ HOME or UPDIR is also a directory
  } DUP2 SWAP TYPE POS 1 + GET EVAL @ Dispatch on Destination object type
  SWAP ROT EVAL ROT STOF \>> PADJ

@ Location  ==>  id   [go to actual directory, leave object name on stack]
@ Performs type validation on each component of a path.
\<< { } + 1 \<< @ [G/GX only]
  NSUB ENDSUB \=/ { HOME UPDIR } 3 PICK POS
  0 { OVER VTYPD 15 \=/ OVER AND } IFTE
  { 515 DOERR } IFT { EVAL } IFT \>> DOSUBS OBJ\-> DROP \>> PGTO

} @ End of a list of programs and their names.

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