home *** CD-ROM | disk | FTP | other *** search
- /*
- * WordSpellCallBack.rexx ... needed by WordSpell.ced.
- * Copyright © 1991, 1992 Loren J. Rittle
- * Reworked for GUISpell public release: Thu Mar 26 02:12:39 1992 LJR
- * Use as you will, just document your changes and keep my copyright
- * notice intact.
- *
- * Loren J. Rittle
- * rittle@comm.mot.com
- */
- options results
-
- address 'rexx_ced'
-
- parse arg oldbytepos oldlinepos olditem
-
- status 87; bytepos = result; if bytepos ~= oldbytepos then exit;
- status 57; linepos = result; if linepos ~= oldlinepos then exit;
- 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 ~= olditem then exit;
-
- address 'GUISpell' currenttext
- replacementword = result
- right
- search for... item 0 0 0 1
- if rc ~= 0 then exit;
- status 57; linepos = result; if linepos ~= oldlinepos then exit;
- left
- replace item replacementword 0 0 1 1
-
- exit
-