/* $VER: PrintDir.filer 2.1 (2.4.95) Author: Matthias Scheler (tron@lyssa.owl.de) Function: Opens a string requester, asks for a output file and writes a listing of the selected directory listview to the output file. History: 2.1 removed unnecessary ADDRESS 'FilerRexx' Call: PrintDir Example for "Filer.RC": BUTTON ...,...,"Print Dir","PrintDir" */ OPTIONS RESULTS GETSOURCEPATH IF RESULT="RESULT" THEN EXIT 5 SourceDir=RESULT LOCKFILER IF RESULT="RESULT" THEN EXIT 5 Key=Result PANEL OFF 'STATUS Print directory' 'SETSTRING PRT:' GETSTRING 'Choose file, or printer:' IF RESULT="RESULT" THEN DO PANEL ON UNLOCKFILER Key EXIT 5 END TargetName=RESULT IF OPEN('Prt',TargetName,'WRITE')=0 THEN DO PANEL ON UNLOCKFILER Key ALERTBOX "Couldn't open output file !" EXIT 5 END 'STATUS Printing directory "'||SourceDir||'" to "'||TargetName||'" ...' CALL WRITELN('Prt','Directory "'||SourceDir||'":') GETNUMENTRIES Num=RESULT DO Index=1 TO Num GETNAME Index Name=RESULT GETINFO Index Info=RESULT IF UPPER(LEFT(Name,1))='F' THEN Line=LEFT(SUBSTR(Name,2)||' ',31) ELSE Line=X2C(1B)||'[1m'||LEFT(SUBSTR(Name,2)||' ',31)||X2C(1B)||'[0m' CALL WRITELN('Prt',Line||Info) END CALL WRITECH('Prt',X2C(C)||X2C(1B)||'[0m') CALL CLOSE('Prt') 'HISTORY Printed directory "'||SourceDir||'" to "'||TargetName||'".' PANEL ON UNLOCKFILER Key