home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / proasm / rexx / ttx / assemble.ttx next >
Text File  |  1996-04-29  |  3KB  |  84 lines

  1. /******************************************************************************
  2.  
  3.  ASX Assembler Script for TurboText
  4.  
  5.   © 1993 by Michael "TILT!" Ryffel
  6.   [some parts ripped from d.weber]
  7.  
  8.  ******************************************************************************
  9.  
  10.  this script could eventually check if asx is already running, and if not
  11.  start it.. in this release arexx reports an error like "port not found.."
  12.  to start asx you can use the popup function af the ttx/asx menu
  13.  
  14.  ******************************************************************************/
  15.  
  16. OPTIONS RESULTS                                  /* uups... */
  17.  
  18.  
  19. editorID='TTX'                                   /* set editor id */
  20.  
  21.  
  22. GetPort                                          /* get the rexx_port of the active */
  23. ttx_port=RESULT                                  /* window, need it later */
  24.  
  25.  
  26. GetFilePath                                      /* get the filepath to create */
  27. name=RESULT                                      /* the id & the tempfile */
  28. SaveFileAs "Ram:TTX_ASM.S"                       /* save file to ram */
  29. SetFilePath name                                 /* reset the filename */
  30.  
  31.  
  32. address command "delete >nil: ram:TTX_ASM.EXE"   /* delete old EXECUTABLE */
  33.  
  34.  
  35. ADDRESS 'asx_rexx'                               /* address asx */
  36. FindID editorID':'name                           /* is this source already used */
  37. port = result                                    /* get the port */
  38.   DO WHILE port~=''                              /* address assembly job */
  39.     ADDRESS (''||port)                           /* arexx weirdness... */
  40.     EndOfAssembly         /* kill job */
  41.     ADDRESS 'asx_rexx'                           /* readdress asx */
  42.     FindID editorID':'name                       /* is there another active job */
  43.     port = result                                /* get the next port */
  44.   END                                            /* redo this stuff */
  45.  
  46.  
  47. BegOfAssembly             /* begin a new job */
  48. port = result                                    /* get its port */
  49.  
  50.  
  51. IF port~='' THEN DO         /* did i get the new job? */
  52.   ADDRESS (''||port)         /* arexx weirdness */
  53.   DefineID editorID':'name         /* set an id (need this for ttx) */
  54.   Assemble "ram:ttx_asm.s -oram:ttx_asm.EXE"     /* assemble to tempfile */
  55.  
  56.                            /* parse the assembler result */
  57.  
  58.   PARSE VALUE result WITH 1 'E:'err' W:'war'O:'opi'/'opb'C:'cod'S:'wor
  59.  
  60.  
  61.   ADDRESS (''||ttx_port)                     /* address turbotext */
  62.   SETSTATUSBAR (err" Errors  "war" Warnings")    /* write to windowtitlebar */
  63.  
  64.  
  65.                                                  /* do the funky stuff */
  66.  
  67.   call open 'console','con:40/50/600/200/  ...MESSAGE...FROM...ASX...  /CLOSE/SCREENTURBOTEXT','W'
  68.   call writeln 'console',('')
  69.   call writeln 'console',('   File ['name'] assembled')
  70.   call writeln 'console',('')
  71.   call writeln 'console',('   'cod' Bytes Objectfile')
  72.   call writeln 'console',('   'err' Errors')
  73.   call writeln 'console',('   'war' Warnings')
  74.   call writeln 'console',('   'opi' Optimizations saved 'opb' Bytes')
  75.   call writeln 'console',('   'wor' Bytes Workspace used')
  76.   call writeln 'console',('')
  77.   call writeln 'console',('')
  78.   call writeln 'console',('')
  79.   call writeln 'console',('                                   [Press Return or Close Window]')
  80.   call readln 'console'
  81.  
  82.  
  83. END                         /* get out of this mess */
  84.