home *** CD-ROM | disk | FTP | other *** search
- /*
- * WordSpell.ced ... ARexx Program to spell check a word while in CED!
- * Requires ISpell version 2.1ljr (or later) with ARexx Server mode.
- * Started: LJR 12/19/89
- * Updated for CED v2.0: LJR Tue Jan 23 03:11:24 1990
- * Updated for OS 2.04: LJR Sat Nov 23 17:40:36 1991
- * Updated for IGadSpell: LJR Sun Dec 8 17:01:41 1991
- * Reworked for GUISpell public release: Thu Mar 26 02:12:39 1992 LJR
- * Copyright © 1989, 1990, 1991, 1992 Loren J. Rittle
- * Use as you will, just document your changes and keep my copyright
- * notice intact.
- *
- * Loren J. Rittle
- * rittle@comm.mot.com
- */
-
- options results
-
- if ~show(ports, 'IRexxSpell') then
- do
- address command 'run <nil: >nil: ispell -r >nil: <nil:'
- address command waitforport 'IRexxSpell'
- end
-
- status 87; bytepos = result;
- status 57; linepos = result;
- status 55; line = result;
- parse var line curline '0a'x
-
- curpos = 0
- do forever
- curpos=pos('09'x, curline, curpos+1)
- if curpos == 0 then break
- curline = overlay(' ', curline, curpos)
- end
-
- do i = 1 to words(curline)
- if wordindex(curline, i)-1 > bytepos then
- break
- end
-
- item = compress( word( curline, i-1 ), ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
-
- if item = '' then exit
-
- address 'IRexxSpell' quickcheck item
- if result = 'bad' then do
- if ~show(ports, 'GUISpell') then
- do
- address command 'run <nil: >nil: GUISpell <nil: >nil:'
- address command waitforport 'GUISpell'
- end
- if show(ports, 'GUISpell') then
- do
- address 'GUISpell' checkcallbackhook 'rexx:ced/WordSpellCallBack.rexx' bytepos linepos item
- address 'GUISpell' check item
- end
- else
- address 'PingServer' beep
- end
- exit
-