home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER: DMS.dopus5 1.0 (06.06.95)
- Written by Odia The Ultimate.
- ARexx script for DOpus 5 to create a dms file with progress indication.
- Call as 'REXX:DMS.dopus5 {Qp}'.
- */
-
- options results
-
- lf='0a'x
-
- parse arg portname .
-
- if portname~=='' then address value portname
- else exit
-
- lister query source
- handle=word(result,1)
- lister query handle path
- source=result
- if source=='RESULT' then do
- dopus request '"No Drive Selected!" _OK'
- exit
- end
-
- lister query dest
- handle=word(result,1)
- lister query handle path
- dest=result
- if dest=='RESULT' then do
- dopus request '"No Destination Directory Selected!" _OK'
- exit
- end
-
- dopus request '"Please insert disk in drive "'source||lf'_OK|_Cancel'
- if rc==0 then exit
-
- dopus getstring '"Please enter DMS archive name" 8 "" _OK|_Cancel'
- if rc==1 then exit
- dmsname=result
- dmsname=dmsname||.dms
- dmsfile=dest||dmsname
-
-
- dopus request '"Select Crunch Mode" _NONE|HEAVY_1|HEAVY_2|_BEST'
- cmrc=rc
- if cmrc==0 then cmode=BEST
- if cmrc==1 then cmode=NONE
- if cmrc==2 then cmode=HEAVY1
- if cmrc==3 then cmode=HEAVY2
- exit
-
- lister set handle busy on
- lister set handle path dest
- lister set handle progress 80 'Creating 'dmsname
-
- address command 'Run >NIL: <NIL: DMS <NIL: >PIPE:dmsout READ' dmsfile 'FROM' source 'CMODE' cmode
- address command 'Status >T:ProcessNo COMMAND DMS'
- call open('temp','T:ProcessNo','r')
- process=readln('temp')
- close('temp')
- address command 'Delete >NIL: T:ProcessNo QUIET'
-
- nomessage=1
- errorreport=''
- buffer=''
- call open('dmsout','PIPE:dmsout','r')
-
- do until eof('dmsout')
- buffer=buffer||readch('dmsout',25)
- here=verify(buffer,'0a0d'x,'m')
- if here>0 then do
- line=left(buffer,here-1)
- if nomessage&left(line,7)='No Disk' then do
- lister set handle progress name 'Insert disk in' dest
- nomessage=0
- end
- parse var line ' ' line
- buffer=substr(buffer,here+1)
- if pos('ERROR',upper(line))>0 then do
- errorreport=errorreport||lf||line
- say '07'x
- end
- if pos('Packing',line)>0 then do
- track=substr(line,18,2)
- lister set handle progress count track+1
- lister set handle progress name 'Packing Track' track
- lister query handle abort
- if result then do
- address command 'Break' process 'C'
- lister set handle busy off
- lister set handle title 'DMS aborted...'
- lister refresh handle full
- exit
- end
- end
- end
- end
-
- call close('dmsout')
-
- lister set handle busy off
- lister read handle dest force
- lister set handle title dest
- lister refresh handle full
-
- if errorreport~=='' then
- dopus request '"DMS Error Report'||lf||errorreport'" OK'
-