jn163051@longs.LANCE.ColoState.Edu (Joel Nevison) (11/28/89)
Here are a couple utilities I've worked out
PRG -This program purges all type 0 (real number) variables, EQ and PPAR
from the current directory. There is a protection feature that prevents
the purging of type 0 variables from a directory. To protect a
directory store a binary object as the rightmost variable.
PRG[6A31]
<< { EQ PPAR } PURGE
VARS LIST-> 1 SWAP
FOR X DUP
IFERR RCL
THEN
END TYPE DUP 0
== SWAP 10 ==
<< ABORT >>
IFT
<< PURGE >>
<< DROP >>
IFTE
NEXT
>>
PRDIR -This program dumps to the IR printer; the name of the current
directory, the name and contents of every variable in the current
directory, the names and contents of subdirectories....etc.
PRDIR[6FFF]
<< "DIR = "
IFERR +
THEN
END PATH DUP SIZE
GET ->STR + PR1 DROP
VARS LIST-> 1 SWAP
FOR X DUP
IFERR RCL
THEN EVAL "SUB"
PRDIR
END SWAP PR1
DROP PR1 DROP
NEXT
"END OF SUBDIR" UP
>>
This program calls itself when a subdirectory is encountered, it also calls
a change directory program named UP. UP was posted recently, but I will
include it for completeness.
UP[8FCA]
<< PATH 1 OVER SIZE OVER - SUB #C784h SYSEVAL >>
I hope these are useful to someone out there, and if anyone knows a faster or
smaller way to do these I am always interested in better ways.
Joel Nevison.