home *** CD-ROM | disk | FTP | other *** search
- /* ARexx-Script
- for Using FDB databases and their archives (Meeting Pearls III)
- $VER: FDB.rexx 1.1 (12.10.95)
- ©1995 Khamsonh Marcel Khounlivong
-
- Requirements: FDB bye Klaus Melchior
- ReqList bye Khamsonh Marcel Khounlivong (on CD)
- ARexx
- RexxReqTools (and ReqTools) libraries by Nico François
-
- */
-
- OPTIONS RESULTS
-
- enter = '0a'x
- AssignFile = 'T:FDB_AssignFile'
- ResultFile = 'T:FDB_Result'
-
- CALL AddLib('rexxsupport.library',5,-30)
- CALL AddLib('rexxreqtools.library',5,-30)
-
- ADDRESS command 'Assign EXISTS >'AssignFile' FindDB:'
- IF (RC ~= 0) THEN DO
- error = 'Kein Assign "FindDB:"'enter'Missing assign "FindDB:"'
- CALL error_exit
- END
-
- IF (~Open(inassign,AssignFile,r)) THEN DO
- error = 'Can''t open'enter'"'AssignFile'"'
- CALL error_exit
- END
-
- AssignList = ''
- DO FOREVER
- dir = ReadLn(inassign)
- IF Eof(inassign) THEN BREAK
-
- dir = SubStr(dir,WordIndex(dir,2))
- IF (Right(dir,1) ~= ':') THEN dir = dir'/'
- AssignList = AssignList dir
-
- ADDRESS command 'List >>T:FDB_codes2 'dir'#?.(codes|.codes.lha)#? LFORMAT "%n"'
- END
- CALL Close(inassign)
-
- ADDRESS command 'Sort T:FDB_codes2 T:FDB_codes'
- ADDRESS command 'ReqList VERBOSE CLONERT PAGE=5',
- 'INPUT=T:FDB_codes',
- 'OUTPUT='ResultFile,
- 'LIST=T:FDB_codes',
- 'HEADER="Nutze FDB-Datenbasis...\nuse FDB database..."'
- IF (RC == 5) THEN CALL clean_exit
-
- IF (~Open(inresult,ResultFile,r)) THEN DO
- error = 'Can''t open'enter'"'ResultFile'"'
- CALL error_exit
- END
- Choice = ReadLn(inresult)
- CALL Close(inresult)
-
- SELECT
- WHEN (UPPER(Right(Choice,6)) == '.CODES') THEN DO
- DBChoice = SubStr(Choice,1,Length(Choice)-6)
- CALL fdb_ask
- END
- WHEN (UPPER(Right(Choice,10)) == '.CODES.LHA') THEN DO
-
- Target = rtgetstring('T:','"'Choice'"'enter'entpacken nach ...'enter'unarchive to ...',,
- 'Lha -q x' Choice '...',
- ,,,okay)
- IF (okay == 0) THEN CALL clean_exit
- IF (Right(Target,1) ~= ':') THEN Target = Strip(target,t,'/')'/'
-
- ADDRESS command 'LhA -q x FindDB:'Choice Target
- DBChoice = SubStr(Choice,1,Length(Choice)-10)
-
- IF (~Find(Target,AssignList)) THEN
- ADDRESS command 'Assign ADD FindDB:' Target
-
- CALL fdb_ask
-
- IF (~Find(Target,AssignList)) THEN
- ADDRESS command 'Assign REMOVE FindDB:' Target
- ADDRESS command 'Delete QUIET' Target || DBChoice'.codes'
-
- END
- OTHERWISE NOP
- END
- CALL clean_exit
-
- error_exit:
- CALL rtezrequest(error,,,
- 'Error detected :-(','rtez_flags=ezreqf_centertext')
- clean_exit:
- ADDRESS command 'Delete QUIET T:FDB_#? T:#?.codes'
- EXIT
-
- fdb_ask:
- DBFind = rtgetstring(,'Pattern für Suchbegriff:'enter'Search pattern:'enter'(#? not neccessary)',,
- 'FDB DB='DBChoice '...',
- ,,,okay)
- IF (okay == 0) THEN CALL clean_exit
-
- ADDRESS command 'FDB >T:FDB_codes DB='DBChoice DBFind
- ADDRESS command 'MetaTool T:FDB_codes TEXT'
- RETURN
-
-