home *** CD-ROM | disk | FTP | other *** search
- /*
- * Spell.ced ... ARexx Program to spell check a file while in CED!
- * Requires ISpell version 2.1ljr with ARexx Server mode.
- * Started: LJR ?
- * Updated for CED v2.0: LJR Tue Jan 23 04:22:16 1990
- * Updated for OS 2.04: LJR Sat Nov 23 17:40:36 1991
- * Copyright © 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
-
- status 21
- buffername = result
- errorname = buffername || '.err'
- whereclip = address() || 'where' || buffername
-
- where = getclip(whereclip)
- if where ~== "" then do
- if open('err', 'ram:@@'errorname,'r') = 0 then do
- okay1 'Can''t open ram:errorfile!'
- exit 0
- end
- seek('err', where, 'Begin')
- word = readln('err')
- if word = "" then do
- close('err')
- okay1 "No more errors were found!"
- address command 'delete ram:@@'buffername 'ram:@@'errorname
- setclip(whereclip)
- exit 0
- end
-
- address 'IRexxSpell' check word
- line = result
- parse var word '&' choices
-
- search for... word 0 0 1 1
- if choices = "" then
- okay1 "Nothing good found for" word||"."
- else
- okay1 "Try"||choices||"0a"x||"in place of" word||"."
- where = seek('err', 0, 'Current')
- call setclip whereclip, where
- close('err')
-
- exit 0
- end
-
- if ~show(ports, 'IRexxSpell') then
- do
- address command 'run <nil: >nill: ispell -r >nil: <nil:'
- address command waitforport 'IRexxSpell'
- end
-
- beg of file
- mark block
- 'end of file'
- copy block
- 'save block to file...' "ram:@@"buffername
- mark block
- left
- copy block
- beg of file
-
- address 'IRexxSpell' filecheck "ram:@@"buffername
- r = result
- if pos('Error', r) ~= 0 then do
- okay1 'ISpell' r
- end
-
- address command copy r "ram:@@"errorname
- address command delete r
- if open('err', 'ram:@@'errorname,'r') = 0 then do
- okay1 'Can''t open ram:errorfile!'
- exit 0
- end
-
- word = readln('err')
- if word = "" then do
- close('err')
- okay1 "No errors were found!"
- address command 'delete ram:@@'buffername 'ram:@@'errorname
- setclip(whereclip)
- exit 0
- end
-
- address 'IRexxSpell' check word
- line = result
- parse var word '&' choices
-
- search for... word 0 0 1 1
- if choices = "" then
- okay1 "Nothing good found for" word||"."
- else
- okay1 "Try"||choices||"0a"x||"in place of" word||"."
-
- where = seek('err', 0, 'Current')
- call setclip whereclip, where
- close('where')
- close('err')
-