home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / lang / mpw_scri.hqx / ExCon.pit / contract next >
Encoding:
Text File  |  1987-02-15  |  1.5 KB  |  71 lines

  1. # Contract - Unexpand Option chars in a file from their 'English' equivalents
  2. #   to their option char form
  3. #
  4. # Use after getting an MPW file as a text file that has been transformed with
  5. #   Expand
  6. #
  7. # Steve Knouse
  8. # Apple Computer
  9. # 2950 N Loop W, Suite 1070
  10. # Houston, TX  77092
  11. # Applelink: KNOUSE
  12.  
  13. # Check syntax
  14. if {#} <> 1 
  15.     echo Error: useage {0} filename
  16.     exit
  17. end
  18.  
  19. # set the target file
  20. target {1}
  21.  
  22. # make sure we don't exit if some of the chars are missing
  23. set exit 0
  24.  
  25. # save the state of CaseSensitive
  26. if {CaseSensitive} == "" 
  27.     set cs 0
  28. else
  29.     set cs 1
  30. end
  31. set CaseSensitive 1
  32.  
  33. # restore the special chars
  34. find Ñ ; replace -c ░ /OpTiOn-2/ '¬'
  35. find Ñ ; replace -c ░ /OpTiOn-=/ '¡'
  36. find Ñ ; replace -c ░ /OpTiOn-./ '│'
  37. find Ñ ; replace -c ░ /OpTiOn-,/ '▓'
  38. find Ñ ; replace -c ░ /OpTiOn-╢// '╓'
  39. find Ñ ; replace -c ░ /OpTiOn-;/ '╔'
  40. find Ñ ; replace -c ░ /OpTiOn-1/ '┴'
  41. find Ñ ; replace -c ░ /OpTiOn-5/ '░'
  42. find Ñ ; replace -c ░ /OpTiOn-6/ 'ñ'
  43. find Ñ ; replace -c ░ /OpTiOn-8/ 'Ñ'
  44. find Ñ ; replace -c ░ /OpTiOn-d/ '╢'
  45. find Ñ ; replace -c ░ /OpTiOn-f/ '─'
  46. find Ñ ; replace -c ░ /OpTiOn-g/ '⌐'
  47. find Ñ ; replace -c ░ /OpTiOn-j/ '╞'
  48. find Ñ ; replace -c ░ /OpTiOn-l ╢(lowercase L╢)/ '┬'
  49. find Ñ ; replace -c ░ /OpTiOn-x/ '┼'
  50. find Ñ ; replace -c ░ /OpTiOn-╢\/ '╟'
  51. find Ñ ; replace -c ░ /OpTiOn-Shift-╢\/ '╚'
  52.  
  53. # special handling for the tag operator
  54. find Ñ
  55.     loop
  56.         find /OpTiOn-r/ || break
  57.         catenate tag_oper > "{target}.ñ"        
  58.     end
  59.     
  60. # go to the top of the file
  61. find Ñ
  62.  
  63. # go to the top of the file
  64. find Ñ
  65.  
  66. # restore Casesensitive
  67. if {cs} == 0
  68.     unset CaseSensitive
  69. end
  70. unset cs
  71.