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

  1. /*
  2.  *  QuickWordSpell.ced ... ARexx Program to spell check a word while in CED!
  3.  *  Requires ISpell version 3.2ljr (or later) with ARexx Server Mode,
  4.  *  the Ping Server (came with VLT, called Ping) and CED version 2.12.
  5.  *  Also requires runback and the NULL: device to startup ISpell in
  6.  *  the background.
  7.  *
  8.  *  This quick version just beeps if the word is not found.
  9.  *  This version can be used to setup a spell check as you type
  10.  *  system under CED and possibly other text editors.  Under CED, 
  11.  *  just define a macro for the space bar.  Have the macro perform 
  12.  *  the following: `Send Dos/ARexx command...' QuickWordSpell, space.
  13.  *
  14.  *  Started around: Sat Jan 05 03:51:37 1991  LJR
  15.  *  Hacked on a bit: Thu Jan 17 17:17:26 1991  LJR
  16.  *  Finished: Fri Feb  1 06:41:08 1991  LJR
  17.  *  Copyright (C) 1991  Loren J. Rittle
  18.  *  Use as you will, just document your changes and keep my copyright
  19.  *  notice intact.
  20.  */
  21. options results
  22.  
  23. if pos('IRexxSpell',(show(ports))) = 0 then do
  24.     address command 'runback ispell -r >null: <null:'
  25.     address command waitforport 'IRexxSpell'
  26. end
  27.  
  28. status 87; bytepos = result;
  29. status 55; line = result;
  30. parse var line curline '0a'x
  31.  
  32. curpos = 0
  33. do forever
  34.   curpos=pos('09'x, curline, curpos+1)
  35.   if curpos == 0 then break
  36.   curline = overlay(' ', curline, curpos)
  37. end
  38.  
  39. do i = 1 to words(curline)
  40.     if wordindex(curline, i)-1 > bytepos then
  41.     break
  42.   end
  43.  
  44. item = compress( word( curline, i-1 ), ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
  45.  
  46. if item = '' then exit
  47.  
  48. address 'IRexxSpell' quickcheck item
  49. if result = 'bad' then address 'PingServer' beep
  50. exit
  51.