home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
opus
/
v5
/
deassign
/
deassign.lha
/
DeAssign.dopus5
next >
Wrap
Text File
|
1997-07-29
|
3KB
|
100 lines
/* DeAssign.dopus5 1.0 (29 JUL 97)
** by Charles Patterson <midian@azstarnet.com>
** http://www.azstarnet.com/~midian
**
** Description: Removes all Assigns to the selected drawer then deletes
** the drawer (optional)
**
** Requirements: Directory Opus v5.5 (© 1996 by Jonathan Potter & GPSoftware)
**
** Instructions: Set DEL to 1 if you want it to delete the directory without
** asking.
** Change the DEVICE and NAMES settings for your system
** Copy script to DOpus5:Arexx
** Create button
** ----------------------------------------------------------------------
** [ARexx] DOpus5:ARexx/DeAssign.dopus5 {Qp} {f}
** ----------------------------------------------------------------------
** flags: Rescan source
**
** --- Requester to delete drawer? --- */
DEL=0
DEVICE.1="DH0:"
NAME.1 = "Workbench:"
DEVICE.2="DH1:"
NAME.2 = "Work:"
DEVICE.3="DH2:"
NAME.3 = "Comms:"
DEVICE.4="RAM:"
NAME.4 = "Ram Disk:"
DEVICES=4
OPTIONS RESULTS
TEMPFILE="T:Assignlist"
PARSE ARG DOpusPort path
DOpusPort = STRIP(DOpusPort,"B",'" ')
path = STRIP(path,"B",'" ')
IF DOpusPort="" THEN DO
SAY "Not correctly called from Directory Opus 5!"
SAY "Load this ARexx script into an editor for more info."
EXIT
END
If ~SHOW("P",DOpusPort) THEN DO
SAY DOpusPort "is not a valid port."
EXIT
END
ADDRESS VALUE DOpusPort
dopus version
IF ( result='RESULT' | TRANSLATE(result,'.',' ') < 5.1218 ) THEN DO
dopus request '"This script requires DOpus v5.5 or greater." OK'
EXIT
END
count=0
ADDRESS COMMAND 'ASSIGN DIRS >'TEMPFILE
OPEN('assigns',TEMPFILE,'R')
assign.=''
n = 0
line = READLN('assigns')
DO WHILE ~EOF('assigns')
line = READLN('assigns')
j=n
n=n+1
PARSE VAR line assign.n dir.n
dir.n=STRIP(dir.n)
IF assign.n="+" THEN assign.n=assign.j
dev=0
DO k=1 to DEVICES
IF LEFT(dir.n,POS(':',dir.n)) = NAME.k THEN dev=k
END
IF dev ~=0 THEN DO
dir.n=RIGHT(dir.n,LENGTH(dir.n)-POS(':',dir.n))
dir.n=DEVICE.dev||dir.n
END
IF dir.n = path THEN DO
count = count +1
rassign.count = assign.n
END
END
CLOSE('assigns')
IF count>0 THEN
DO c = 1 to count
ADDRESS COMMAND 'ASSIGN 'rassign.c':'
IF ~DEL THEN DO
DOPUS REQUEST '"Do you wish to delete the directory?" Yes|No'
DEL=RC
END
IF DEL THEN ADDRESS COMMAND DELETE path
END
ADDRESS COMMAND DELETE TEMPFILE
EXIT