! tree.tes - display directory tree ! !tree.tec! 24W ! screen height to 24 lines ! 16@EN%\*.*% ! 16=directories only ! ! \=go up to root (of current drive) ! ! *.*=anything matches ! < ! loop on directory level ! < ! loop on file entries ! :@EN%%; ! advance to next entry, exit loop if end ! G* ! insert the entry ! -^S,-:@S%\%"F ! if no (last) "\" ! ZJ ! go to end of buffer ! 0L ! then start of line ! ' ! endif ! ! at this point if the entry had "\"(s) ! ! we are positioned after the last "\" ! ! if the entry had no "\"(s) as for the ! ! root directory we are positioned at ! ! the start of the line. ! 0A-^^."E ! if the 1st letter of last name is "." ! 0KK ! kill the line ! F< ! continue (go on to next entry) ! ' ! endif "." file ! ZJ ! go to end of line ! @I% % ! insert a ! -L ! backup to start of new directory name ! 0A-^^\"E D ' ! iif 1st letter is a "\" delete it ! 0UC ! zero a "\" counter ! < ! loop to count "\"(s) ! :@S%\%; ! find "\", exit loop if no more ! %C$ ! incriment "\" count, ignore result ! .UP ! remember where last "\" was ! > ! end loop ! QC"G ! if and "\"(s) ! QPJ ! position after last "\" ! 0K ! kill to start of line ! QC< ! repeate # "\" times ! @I% % ! insert ! > ! end repeate ! ' ! endif "\"(s) found ! ZJ ! end of buffer ! W ! refresh the screen ! 16::@EN%\*.*% ! push down a file search level (::EN) ! > ! end loop on file name (directory entry) ! -:@EN%%; ! pop up a directory level, exit if no more ! > ! end directory level loop !