[comp.sys.handhelds] Cleanup of directories

jn163051@longs.LANCE.ColoState.Edu (Joel Nevison) (07/12/90)

     I have been using a routine that purges the excess variables from my 
directories which I call PRG (purge).   This is especially useful for 
those directories in which I do a lot of solving or plotting to get rid 
of the numerous variables created by those operations.   

     PRG uses a variable that I put in each directory named KEEP which 
contains the name of the left-most object in that directory that I want 
to keep.   PRG executes VARS and then purges the names from that list 
until it matches a name with the contents of KEEP to halt the program.   

     I also use a subsidiary program called SAV which updates KEEP with the 
name of the current left most variable.  This is used when I have added new 
objects to a directory that I want to save.   You need to run SAV any time 
you add objects to a directory or change the order of a directory.   

     To set this up put PRG and SAV in your HOME directory, then you must 
go to each of your directories and create the variable named KEEP, then 
run SAV.   Make sure you get this correct because an incorrect KEEP can 
result in things you want getting wiped.   Just check that KEEP contains 
the name of the first object in each directory.   Sub-directories are safe
though, because PURGE won't touch a non-empty sub-directory.

     I have also assigned PRG to the right shifted DEL key which seemed a 
logical place (thanks HP for not putting anything important there).
To make this assignment put << PRG >> on the stack then 54.3 then ASN EVAL.
And of course you need to have USER mode turned on.   You could similarly
assign SAV to a key that you don't use often.

PRG

%%HP: T(3)A(R)F(.);
\<< 1 VARS \-> A V
  \<<
    WHILE V A GET
DUP KEEP 1 GET SAME
NOT
    REPEAT PURGE
'A' INCR DROP
    END DROP
  \>>
\>>

SAV

%%HP: T(3)A(R)F(.);
\<< VARS 1 GET 1
\->LIST 'KEEP' STO
\>>

Good luck, and happy computing....
                                  ...Joel Nevison


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Substitution mass confusion   /           Joel Nevison                  |
|    Clouds inside my head     /  jn163051@longs.lance.colostate.edu      |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~