'set novalue on' /* force KEXX and its way of SIGNAL ON NOVALUE */ /* Usage: [MACRO] TREE [root(s)] */ /* Example: TREE C:\ */ /* History: based on SAMPLES\TREE.KEX version 5.0, May 1992 */ /* supporting id.s with embedded blanks (HPFS) and */ /* long id.s truncated by * depending on DIRFORMAT */ /* Corrections: - DIRAP DIRFileid.1() enclosed in double quotes */ /* - Do NOT forever DIRAP DIRF.1() containing stars */ /* - AUTOSAVE OFF unnecessary for Kedit 5.0 DIR.DIR */ /* - Add \ to DIRFileid.1() to support "empty" names */ /* when directory name actually starts with a dot */ /* Addition: Found truncated directory id.s containing stars */ /* are TAGged - the shown TREE is then incomplete */ /* Requires: Kedit 5.0 (Frank Ellermann, 1999) */ 'extract /DEFSORT/SHADOW/' ; 'set defsort off' 'dir' arg( 1 ) ; if rc <> 0 then exit RESET( rc ) 'set shadow off' /* show progress without shadows */ do DIR = 1 /* use relative DIR line numbers */ 'nomsg all //' ; ':0' DIR /* next DIRectory */ if rc <> 0 then leave ; 'refresh' /* show progress */ if pos( '*', dirfileid.1()) > 0 then iterate /* truncations */ 'more tag :' || line.1() /* tag processed dir. for delete */ 'nomsg dirappend "' || dirfileid.1() || '\"' end 'nomsg all tagged' ; if rc = 0 then 'delete all' 'all' ; 'nomsg tag //' if rc = 0 then 'emsg TAGged truncated directory id.s skipped' 'nomsg dirsort' DEFSORT.1 ; ':0 forward half' 'set alt 0 0' ; exit RESET( 0 ) RESET: 'set shadow' SHADOW.1 'set defsort' DEFSORT.1 ; return arg( 1 )