home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
wp_dtp
/
ispell.lha
/
Spell.ced
< prev
next >
Wrap
Text File
|
1991-02-08
|
2KB
|
100 lines
/*
* Spell.ced ... ARexx Program to spell check a file while in CED!
* Requires ISpell version 2.1ljr with ARexx Server mode.
* Started: LJR ?
* Updated: LJR 12/26/89 1/10/90 1/23/90
* Updated for CED v2.0: LJR Tue Jan 23 04:22:16 1990
* Last update: LJR Thu Jun 14 20:07:46 1990
* Copyright (C) 1990 Loren J. Ritte
* Use as you will, just document your changes and keep my copyright
* notice intact.
*/
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 pos('IRexxSpell',(show(ports))) = 0 then do
address command 'runback ispell -r >null: <null:'
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')