home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
216.lha
/
Magus!
/
Magus!Util.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-02-15
|
4KB
|
121 lines
/*---------------------------- Start REXX Source ----------------------------*/
/* Magus!Util.rexx
Magus! Print Spooler
v1.00 Associated files: Magus!.rexx
Magus!Cntl.rexx
by MPrint.rexx
Dan Schenck MPrintIt.rexx
Tulsa, OK
GEnie: D.SCHENCK
(918) 492-0523
*/
/* Requires rexxarplib.library v2.1 */
arg task .
true = 1
false = 0
done = false
select
when (task = "ABORTJOB") | (task = "LISTQ") then
do until(done)
if GetEnv('printit_pgm') = 'ACTIVE' then
do
call writech(STDOUT,'9B'x || '1;1H' || '9B'x || '2J')
say ' '
say 'ARexx Print Spooler Queue'
say ' '
do while(GetEnv('prnt_spooler') = 'GETTINGCLIP')
call delay(25)
end
rtn = SetEnv('prnt_spooler','GETTINGCLIP')
current_pointer = GetEnv('current_print')
fwrd_pointer = current_pointer
status = 'Active'
pct_read = trunc(nint(GetEnv('%_read')+.5))
if pct_read < 10 then pct_read = " "||pct_read
i = 0
say "# Status % Copies File"
do while((fwrd_pointer ~= 'null') & (fwrd_pointer ~= ""))
i = i + 1
file_no.i = i
instring = GetEnv(fwrd_pointer)
pointer.i = fwrd_pointer
file_name.i = word(instring,2)
call writeln(STDOUT,i || '.' status pct_read ' ' word(instring,4) ' ' word(instring,3))
fwrd_pointer = word(instring,1)
next.i = fwrd_pointer
status = 'Queued'
pct_read = "--"
end
rtn = SetEnv('prnt_spooler',"NA")
say ' '
max = i
if (task = "ABORTJOB" & max > 0) then
do
say 'Enter number of each file to ABORT separated by a space:'
pull files2kill
kill = 1
i = word(files2kill,kill)
rtn = SetEnv('prnt_spooler','GETTINGCLIP')
do while(i ~= "" & file_no.i = i)
if pointer.i = current_pointer then rtn = SetEnv('printit_pgm','ABORT')
else
do
j = i - 1
if i = max then rtn = SetEnv('spool_tail',GetEnv('spool_tail') - 1)
instring = GetEnv(pointer.j)
rtn = SetEnv(pointer.j,next.i subword(instring,2))
rtn = SetEnv(pointer.i,"null")
if (index(upper(file_name.i),"$$M!SPOOL/$$") > 0) then
address command 'delete' file_name.i || " Quiet"
end
file_no.i = -i
kill = kill + 1
i = word(files2kill,kill)
end
task = "LISTQ"
end
else
do i = 1 to 1
call writech(STDOUT,'Enter: "L" to relist queue; "A" to abort job; "Q" to quit. - ')
do until(key = "L" | key = "A" | key = "Q")
key = readln(STDIN)
key = upper(key)
end
select
when key = "L" then leave i
when key = "A" then
do
task = "ABORTJOB"
leave i
end
when key = "Q" then done = true
otherwise done = true
end
end
rtn = SetEnv('prnt_spooler',"NA")
end
else
do
say 'No Files In Print Queue'
call Delay(200)
done = true
end
end
otherwise
do
say 'Invalid operation "' || task || '" requested.'
call Delay(150)
done = true
end
end
exit(0)
/*----------------------------- End REXX Source -----------------------------*/