home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / Programme_zum_Heft / Programmieren / Kurztests / ACE / utils / UppercACEr / MakeReserved.b next >
Text File  |  1994-10-23  |  2KB  |  76 lines

  1. '******************************************
  2. '*              MakeReserved              *
  3. '*   K.Veijalainen (veijalai@cc.lut.fi)   *
  4. '*                                        *
  5. '* For creating UppercACEr.Reserved-files *
  6. '* from ACE's "words"-output files.       *
  7. '*                                        *
  8. '* Add new strings to be ignored in the   *
  9. '* CASE-statement in main loop and        *
  10. '* recompile when new ACE versions appear.*
  11. '*                                        *
  12. '* 31.7.1994 - Work started.              *
  13. '******************************************
  14.  
  15. version$="MakeReserved for ACE2.16 by K.Veijalainen (veijalai@cc.lut.fi)"
  16.  
  17. 'Get the parameters
  18. IF argcount<1 THEN
  19.     PRINT "You must specify the outputfile."
  20.     PRINT "Usage: "+ARG$(0)+" <outputfile>"
  21.     STOP
  22. ELSE
  23.     _outfile$=ARG$(1)
  24. END IF
  25.  
  26. ON BREAK GOTO lopetus
  27. BREAK ON
  28.  
  29. 'Globally declare all variables as short int
  30. DEFINT a-z,_
  31.  
  32. print "Creating temp file..."
  33. SYSTEM "ACE words >t:ReservedTemp1"
  34. 'Sort the file to t:
  35. print "Sorting..."
  36. SYSTEM "sort t:ReservedTemp1 t:ReservedTemp"
  37. kill "t:ReservedTemp1"
  38.  
  39. 'Open the files.
  40. open "I",1,"t:ReservedTemp"
  41. open "O",2,_outfile$
  42.  
  43. 'Gotta advertise a bit.. :-)
  44. print version$
  45. print #2,chr$(39)+version$
  46.  
  47. print "Creating "+_outfile$+"..."
  48. ot$=""
  49. while not eof(1)
  50.     line input #1,t$
  51.     'Remove the dollar signs
  52.     if right$(t$,1)="$" then
  53.         t$=left$(t$,len(t$)-1)
  54.     end if
  55.     l$=left$(t$,20)
  56.     'Was this the same as the one before?
  57.     if ot$<>t$ then
  58.         'Add future lines to be ignored here! (20 characters!)
  59.         CASE
  60.             l$="ACE Amiga BASIC Comp" :  t$=""
  61.             l$="AmigaBASIC RESERVED " :  t$=""
  62.             l$="ACE-SPECIFIC RESERVE" :  t$=""
  63.         END CASE
  64.         'Output to _outfile$, if the line is not empty.
  65.         if len(t$)>0 then print #2,t$
  66.     end if
  67.     ot$=t$
  68. wend
  69. print "Done."
  70.  
  71. lopetus:
  72.     close #1
  73.     close #2
  74.     kill "t:ReservedTemp"
  75.     stop
  76.