home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D2.DMS / in.adf / ObSup_Scripts / TurboText / rexx / CMD.ttx < prev    next >
Encoding:
Text File  |  1992-08-01  |  3.2 KB  |  125 lines

  1. /* ------------------------------------------------------------------------
  2.   :Program.       Cmd.ttx
  3.   :Contents.      Start Oberon tools with TurboText
  4.   :Author.        Kai Bolay [kai] (CED-Version)
  5.   :Address.       Snail-Mail:              E-Mail:
  6.   :Address.       Hoffmannstrasse 168      UUCP: kai@amokle.adsp.sub.org
  7.   :Address.       D-7250 Leonberg 1        FIDO: 2:247/706.3
  8.   :Author.        Jan Geißler [jan] (Turbotext-Anpassung)
  9.   :Address.       Snail-Mail:              E-Mail:
  10.   :Address.       Hermann-Rombach-Str. 17  Zerberus:J.GEISSLER@DALLAS.ZER
  11.   :Address.       D-7120 Bietigheim        FIDO: 2:247/706.5
  12.   :History.       v1.0 [kai] 12-Mar-92
  13.   :History.       v1.1 [kai] 26-Mar-92 (+ first error after compilation)
  14.   :History.       v1.1 [kai] 26-Mar-92 (+ show error only if error)
  15.   :History.       v1.2 [kai] 05-May-92 (+ check for returnvalue, + make)
  16.   :History.       v1.2.1 [jan] 06-Jun-92 (+ fixed for use with TurboText)
  17.   :Copyright.     FD
  18.   :Language.      ARexx
  19.   :Translator.    RexxMast
  20.   :Remark.        LibLink, Execute, etc. not supported yet
  21.   :Remark.        Use AmigaOberon.dfn to get oberon menus & more in TTX!
  22. ------------------------------------------------------------------------ */
  23.  
  24. options results
  25.  
  26. arg tool
  27.  
  28. select
  29.   when tool = "COMPILE" then do
  30.     scriptname = "T:Compiler-Start"
  31.     savefile
  32.   end
  33.   when tool = "MAKE" then do
  34.     scriptname = "T:Make-Start"
  35.     savefile
  36.   end
  37.   when tool = "LINK" then do
  38.     scriptname = "T:Linker-Start"
  39.   end
  40.   otherwise do
  41.     beepScreen
  42.     RequestBool "Fehler:" "Falscher Aufruf!"
  43.     exit
  44.   end
  45. end
  46.  
  47.  
  48. getfileinfo  /* Nur Filnamen (ohne Pfad) holen */
  49. parse var RESULT . . '"' filename '"'
  50.  
  51. if filename = "" then do
  52.   beepScreen
  53.   RequestBool "Fehler:" "Kein Filename"
  54.   exit
  55. end
  56.  
  57. if right(filename,4) ~= ".mod" then do
  58.   beepScreen
  59.   RequestBool "Fehler:" "Filename endet nicht auf '.mod'"
  60.   exit
  61. end
  62. filename = left(filename,length(filename)-4)
  63. say filename
  64.  
  65. getfilepath /* Nur Pfad (ohne Filenamen) holen */
  66. temp = RESULT
  67. path = left(RESULT,length(RESULT)-length(filename)-4)
  68.  
  69.  if length(path) > 3 then do
  70.   if right(path,3) = "txt" then do
  71.     path = left(path,length(path)-3)
  72.   end
  73. end
  74.  
  75.  
  76. if ~open(script,scriptname,'W') then do
  77.   beepScreen
  78.   RequestBool "Fehler:" "Kann Script nicht öffnen"
  79.   exit
  80. end
  81.  
  82. call writeln(script,"FailAt 100")
  83. call writeln(script,"Stack 20000")
  84. call writeln(script,"CD" path)
  85. window = ">CON:0/100//200/Oberon/SCREENTURBOTEXT"
  86. select
  87.   when tool = "COMPILE" then do
  88.     cmd = "oberon:Oberon" window AddOpts("-", "OberonOpts")
  89.   end
  90.   when tool = "MAKE" then do
  91.     cmd = "oberon:OMake" window AddOpts("c-", "OberonOpts") AddOpts("l-", "OLinkOpts")
  92.   end
  93.   when tool = "LINK" then do
  94.     cmd = "oberon:OLink" window AddOpts("-", "OLinkOpts")
  95.   end
  96. end
  97. cmd = cmd filename
  98.  
  99. call writeln(script,cmd)
  100.  
  101. if ~close(script) then do
  102.   beepScreen
  103.   RequestBool "Fehler:" "Kann Script nicht schließen"
  104.   exit
  105. end
  106.  
  107. address command Execute scriptname
  108.  
  109. if RC ~= 0 then do
  110.   if tool = "COMPILE" then do
  111.     address REXX "TURBOTEXT:rexx/Err.ttx FIRST"
  112.   end; else do
  113.   beepScreen
  114.   RequestBool "Fehler:" "Aufruf fehlgeschlagen!"
  115.   end
  116. end
  117.  
  118. exit
  119.  
  120. AddOpts:
  121.   parse arg switch,name
  122.   opts = getclip(name)
  123.   if opts ~= "" then opts = switch || opts
  124. return opts
  125.