%%HP: T(3)A(D)F(.);
@ This program gives you a look of all your subdirectories.
@
@ (Sorry for languages errors (if there is) )
@
@ With all thoses programs for my new hp, I have sometimes difficulties
@ to remember where goes the memory. That's why I have done this program.
@
@ With this program, you can obtain a tree of all the subdirectories
@ of the hp-48, with the memory consume by these subdirectories. You
@ will also be able to print it on your printer.
@
@ Just type in GO. (the stack must be empty)
@ ------------------------------
@ Here, just an example of the result:
@
@  "SAT 11/17/90
@
@  EL.ENG   2983             ; The 2983 bytes included 123 byte from SIGNAUX
@     SIGNAUX   123          ;  and 799  bytes from VISION
@     VISION   799
@
@  GAMES   4114
@
@  UTIL   9491
@     DATES   4383
@        CALEND   4024
@     TELP   1898
@     TERM   2313
@        DTE48   1416
@        INFRA   882
@     TREES   866"
@--------------------------------
@
@  Tree version 1.0.
@
@  The program GO initialize some variables. Next, RECUR call itself recur-
@  sively trought all the subdirectories. To do so, it push at first the
@  path on the stack. Il will be able to retreive itself.
@
@
@  Thanks to Mark Ferris for the starting idea.
@
@ Eric Beaulieu,  Elec. Eng. Depart.
@ Quebec (Quebec) Canada
@ E-mail: gel6 gel.ulaval.ca
@
@------------ CUT HERE ------------
@
DIR
  GO
    \<< DATE 0 TSTR 1
12 SUB 'TREE' STO
PATH 0 'NIV' STO
HOME VARS OBJ\-> 1
SWAP CLLCD
      START PATH
DEPTH PICK EVAL
RECUR
      NEXT EVAL
'NIV' PURGE TREE
    \>>
  RECUR
    \<< EVAL DUP RCL
TYPE
      IF 15 ==
      THEN DUP DUP
BYTES SWAP DROP
FLOOR \-> b
        \<< PATH
DEPTH PICK EVAL
SWAP DUP 2 DISP
TREE SWAP "
"
          IF NIV
          THEN 1
NIV
            START
"   " +
            NEXT
          ELSE "
"
+
          END SWAP
b \->STR "   " SWAP +
+ + + 'TREE' STO 1
'NIV' STO+ EVAL
EVAL VARS OBJ\->
          IF DUP 0
\=/
          THEN 1
SWAP
            START
PATH DEPTH PICK
EVAL RECUR
            NEXT
          ELSE DROP
          END PATH
DEPTH PICK EVAL -1
'NIV' STO+ EVAL
        \>>
      ELSE DROP
      END
    \>>
END

