home *** CD-ROM | disk | FTP | other *** search
- /* printfiles Arexx Macro */
- /* © 1992 by K. Klingbeil */
- /* fügt Dateinamen mittels pattern-matching in die */
- /* Druckliste ein */
- /* Befehl : rx pattern [Einfügepattern] -r[Löschpattern] */
- /* Beispiel : rx pattern #?.c #?.h -rtest#?.c -rtest.h */
- /* fügt alle Dateien im aktuellen */
- /* Verzeichnis, die auf .c oder .h enden in */
- /* die Druckliste und löscht alle dateien */
- /* die test im Namen mit der Endung .c */
- /* und die Datei test.h */
-
- options results /* Ergebnisse anfordern */
- if ~show(ports,'PRINTFILES')then do /* Läuft PrintFiles schon ? */
- address command 'printfiles' /* wenn nicht, dann ein Startversuch */
- address command 'sys:rexxc/WaitForPort PRINTFILES' /* noch ein bisschen abwarten */
- end /* Noch'n Versuch */
- if ~(show(ports,'PRINTFILES')) then return 5 /* Rückgabewert 5 bei Mißerfolg */
-
-
- parse arg CmdLine
- p = words(CmdLine)
-
- do i = 1 to p
- pattern = word(CmdLine,i)
- if left(pattern,2) == '-r' then removefile(substr(pattern,3))
- else insertfile(pattern)
- end
- address printfiles 'print'
- exit
-
- rxfile: procedure
- parse arg template
- cmd = 'rx ' template
- address command cmd
- return 1
-
- removefile: procedure
- parse arg template
- cmd = 'list >pipe:prf' template 'LFORMAT "%P%N" quick'
- address command cmd
- open('p','pipe:prf','r')
- do while ~eof('p')
- file = readln('p')
- if file ~== '' then address printfiles remfile ''file
- end
- close('p')
-
- return 1
-
- insertfile: procedure
- parse arg template
- cmd = 'list >pipe:prf' template 'LFORMAT "%P%N" quick'
- address command cmd
- open('p','pipe:prf','read')
- do while ~eof('p')
- file = readln('p')
- if file ~== '' then address printfiles insfile ''file
- end
- close('p')
- return 1
-
-