home *** CD-ROM | disk | FTP | other *** search
- /* extract.frx
- * Copyright © 1997 Nils Bandener
- * $VER: extract_frx 6.3 (7.10.97)
- */
-
- scriptname = "Extract"
-
- Options Results
-
- /*
- * If not called from Fiasco, try to address the active
- * Fiasco project
- */
-
- if ~abbrev(address(), "FIASCO.") then
- do
- /* Get list of all available ports */
-
- ports = show("Ports")
-
- /* Search for a port of Fiasco */
-
- do i = 1 to words(ports)
-
- if abbrev(word(ports, i), "FIASCO.") then
- do
- /* A port of Fiasco has been found.
- * Now query Fiasco to return the port
- * name of the active database.
- */
-
- Address Value word(ports, i)
-
- GetAttr Project Name Active ARexx
-
- Address Value Result
-
- break
- end
- end
- end
-
- fiasco_port = address()
-
- Signal on Syntax
- Signal on Halt
- Signal on Break_C
- Signal on Failure
-
- LockGUI
-
- ActiveRecord
-
- if result ~= 0 then
- do
- GetField "CD Var CD"
- GetField "Directory Var Dir"
- GetField "Archive Var Arc"
-
- Archive = CD || ":Aminet/" || Dir || "/" || Arc
-
- RequestFile "RAM: DrawersOnly Var dest"
-
- if rc = 0 then
- do
- Address Command
-
- if right(dest, 1) ~= ":" & right(dest, 1) ~= "/" then
- do
- dest = dest || "/"
- end
-
- signal off failure
-
- "lha x" Archive dest
-
- if rc ~= 0 then
- do
- Address Value fiasco_port
-
- RequestChoice '"Error Executing Archiver*nRC: ' || RC ||'" "Cancel" Title "Extract File"'
- end
- end
- end
- else
- do
- RequestChoice '"No record active" "Cancel" Title "Extract Archive"'
- end
-
- bail_out:
-
- Address Value fiasco_port
-
- UnlockGUI
- ResetStatus
-
- exit
-
- syntax:
- failure:
-
- if show("Ports", fiasco_port) then
- do
- Address Value fiasco_port
-
- RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
- end
- else
- do
- say "Error" rc "in line" sigl ":" errortext(rc)
- say "Enter to continue"
- pull dummy
- end
-
- call bail_out
-
- halt:
- break_c:
-
- if show("Ports", fiasco_port) then
- do
- Address Value fiasco_port
-
- RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
- end
- else
- do
- say "*** Break"
- say "Enter to continue"
- pull dummy
- end
-
- call bail_out
-
-
-
-