CED and AREXX
3 messages in this thread
I just got CygnusEd Professional and it's great. I immediately started
experimenting with it and AREXX, writing a small macro to remove the 'More
[Y]?' from my UseNet message files. Here is what I started with:
* This program removes 'More [Y]?' line from UseNet files*/
address 'rexx_ced'
beg of file
do i=1 to 100
search for 'More [Y]?'
delete line
end i
exit
It all seems to work OK except for one problem. It only finds 'More'. A
little experimenting seems to show that nothing after a space is passed to
CED. If I look at the 'Search for' requestor after running my macro, the
requestor only shows 'More'. If I type 'More [Y]?' directly into the
SEARCH requestor everything works OK. Any sugguestions?
Also, in fooling around with this, I managed to get myself in a 'do
forever' loop. When it got to the end of the file, it keep trying to
execute and I was unable to get out of the macro and had to reboot. Any
suggestions?
CED is a great program. Keep it up!
Congratulations, you've just hit the CED feature that annoys me the most.
Actually, I believe that the whole string gets passed to CED just fine. But
when you code:
search for "More [Y]"
this is equivalent to the statement:
"search for More [Y]"
CED's parser isn't very sophisticated, using any occurrence of a space to
delimit its arguments. If you think your example is annoying, try using the
"replace" command from ARexx to replace text in a search string containing a
blank. Like this:
replace "french fries" "onion rings"
You can't do it. It will replace "french" with "fries".
(continued)
(continuation)
CED's author could do a couple of things to fix this problem. One of them
would be to modify the parser so that blanks inside quotes are not delimiters.
(Well, technically this is a scanner modification. 🙂 Then, if you wanted to
pass arguments containing blanks, you could do it like this:
replace '"french fries"' '"onion rings"'
If you do this with the present version, I believe that the '"' chars are
interpreted literally.
Another solution would be to provide actual Rexx functions for some of these
operations: e.g.:
call replace("french fries", "onion rings")
Then the arguments would be passed in separate arg strings, rather than
concatenated into one big arg string.
(BTW, it would be nice if "replace" could do global replacement from a Rexx
macro…)
Regards, Lee