home *** CD-ROM | disk | FTP | other *** search
- /* ------------------------------------------------------------------------
- :Program. Cmd.ttx
- :Contents. Start Oberon tools with TurboText
- :Author. Kai Bolay [kai] (CED-Version)
- :Address. Snail-Mail: E-Mail:
- :Address. Hoffmannstrasse 168 UUCP: kai@amokle.adsp.sub.org
- :Address. D-7250 Leonberg 1 FIDO: 2:247/706.3
- :Author. Jan Geißler [jan] (Turbotext-Anpassung)
- :Address. Snail-Mail: E-Mail:
- :Address. Hermann-Rombach-Str. 17 Zerberus:J.GEISSLER@DALLAS.ZER
- :Address. D-7120 Bietigheim FIDO: 2:247/706.5
- :History. v1.0 [kai] 12-Mar-92
- :History. v1.1 [kai] 26-Mar-92 (+ first error after compilation)
- :History. v1.1 [kai] 26-Mar-92 (+ show error only if error)
- :History. v1.2 [kai] 05-May-92 (+ check for returnvalue, + make)
- :History. v1.2.1 [jan] 06-Jun-92 (+ fixed for use with TurboText)
- :Copyright. FD
- :Language. ARexx
- :Translator. RexxMast
- :Remark. LibLink, Execute, etc. not supported yet
- :Remark. Use AmigaOberon.dfn to get oberon menus & more in TTX!
- ------------------------------------------------------------------------ */
-
- options results
-
- arg tool
-
- select
- when tool = "COMPILE" then do
- scriptname = "T:Compiler-Start"
- savefile
- end
- when tool = "MAKE" then do
- scriptname = "T:Make-Start"
- savefile
- end
- when tool = "LINK" then do
- scriptname = "T:Linker-Start"
- end
- otherwise do
- beepScreen
- RequestBool "Fehler:" "Falscher Aufruf!"
- exit
- end
- end
-
-
- getfileinfo /* Nur Filnamen (ohne Pfad) holen */
- parse var RESULT . . '"' filename '"'
-
- if filename = "" then do
- beepScreen
- RequestBool "Fehler:" "Kein Filename"
- exit
- end
-
- if right(filename,4) ~= ".mod" then do
- beepScreen
- RequestBool "Fehler:" "Filename endet nicht auf '.mod'"
- exit
- end
- filename = left(filename,length(filename)-4)
- say filename
-
- getfilepath /* Nur Pfad (ohne Filenamen) holen */
- temp = RESULT
- path = left(RESULT,length(RESULT)-length(filename)-4)
-
- if length(path) > 3 then do
- if right(path,3) = "txt" then do
- path = left(path,length(path)-3)
- end
- end
-
-
- if ~open(script,scriptname,'W') then do
- beepScreen
- RequestBool "Fehler:" "Kann Script nicht öffnen"
- exit
- end
-
- call writeln(script,"FailAt 100")
- call writeln(script,"Stack 20000")
- call writeln(script,"CD" path)
- window = ">CON:0/100//200/Oberon/SCREENTURBOTEXT"
- select
- when tool = "COMPILE" then do
- cmd = "oberon:Oberon" window AddOpts("-", "OberonOpts")
- end
- when tool = "MAKE" then do
- cmd = "oberon:OMake" window AddOpts("c-", "OberonOpts") AddOpts("l-", "OLinkOpts")
- end
- when tool = "LINK" then do
- cmd = "oberon:OLink" window AddOpts("-", "OLinkOpts")
- end
- end
- cmd = cmd filename
-
- call writeln(script,cmd)
-
- if ~close(script) then do
- beepScreen
- RequestBool "Fehler:" "Kann Script nicht schließen"
- exit
- end
-
- address command Execute scriptname
-
- if RC ~= 0 then do
- if tool = "COMPILE" then do
- address REXX "TURBOTEXT:rexx/Err.ttx FIRST"
- end; else do
- beepScreen
- RequestBool "Fehler:" "Aufruf fehlgeschlagen!"
- end
- end
-
- exit
-
- AddOpts:
- parse arg switch,name
- opts = getclip(name)
- if opts ~= "" then opts = switch || opts
- return opts
-