home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / ispell.lha / WordSpell.ced < prev    next >
Text File  |  1991-02-08  |  2KB  |  52 lines

  1. /*  
  2.  *  WordSpell.ced ... ARexx Program to spell check a word while in CED!
  3.  *  Requires ISpell version 2.1ljr with ARexx Server mode and CED v2.12.
  4.  *  Started: 12/19/89
  5.  *  Updated for CED v2.0: Tue Jan 23 03:11:24 1990
  6.  *  Last update: Fri Feb  1 07:46:30 1991
  7.  *  Copyright (C) 1989, 1990, 1991  Loren J. Rittle
  8.  *  Use as you will, just document your changes and keep my copyright
  9.  *  notice intact.
  10.  */
  11. options results
  12. if pos('IRexxSpell',(show(ports))) = 0 then do
  13.     address command 'runback ispell -r >null: <null:'
  14.     address command waitforport 'IRexxSpell'
  15. end
  16.  
  17. status 87; bytepos = result;
  18. status 55; line = result;
  19. parse var line curline '0a'x
  20.  
  21. curpos = 0
  22. do forever
  23.   curpos=pos('09'x, curline, curpos+1)
  24.   if curpos == 0 then break
  25.   curline = overlay(' ', curline, curpos)
  26. end
  27.  
  28. do i = 1 to words(curline)
  29.     if wordindex(curline, i)-1 > bytepos then
  30.     break
  31.   end
  32.  
  33. item = compress( word( curline, i-1 ), ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
  34.  
  35. if item = '' then exit
  36.  
  37. address 'IRexxSpell' check item
  38. r = result
  39. r1 = substr(r,1,1)
  40. select
  41.     when r1 = '*' then nop
  42.     when r1 = '&' then 
  43.         if words(r) = 2 then 
  44.             okay1 "The word '"||item||"' is not found."||"0A"X||"Try this word:" substr(r,3)
  45.         else
  46.             okay1 "The word '"||item||"' is not found."||"0A"X||"Try these words:" substr(r,3)
  47.     when r1 = '#' then okay1 "Nothing even close to '"||item||"' found in dictionary!"
  48.     when r1 = '+' then nop    /* spell would print a warning here! */
  49.     otherwise okay1 "For the word '"||item||"' I got" r
  50.     end
  51. exit
  52.