#small AREX problem
6 messages in this thread
I am not very experienced with AREX and am trying to write a
small program to use with newsgroup files.
As the file is scanned, each time the line "Subject:" is encountered I
would like to clear the screen and start the new screen with that line.
Here's the problem.
no matter what I try I cant seem to clear the screen from within the AREX
program. There is a "clear" alias which works fine from the CLI but I
can't make it work from within the program (or anything else for that
matter).
I know that as problems go this is not a big one but at the moment it's
got me stumped and the documentation isn't helping.
Thank you,
_| _ ' _|
… (_|/-\\/|(_|
The clear alias is just a way to print certain ANSI escape sequences to
the screen, which it interprets as commands to clear the screen, change
the type colors, etc. From ARex you could either do:
CLEAR_CMD='*E[0;0H*E[J'
address command 'echo '||CLEAR_CMD
or maybe just:
say CLEAR_CMD
note that the *E are just an amigados trick for doing the escape
character, which can also be had with Arexx' D2C(27):
CLEAR_CMD = D2C(27)||"[0;0H"||D2C(27)||"[J"
Arnie,
/* Say thank you to Arnie */
CLEAR_CMD='*E{0;0H*E[J'
DO 100
SAY " Thanks for the help Arnie"
SAY "it was exactly what I needed."
END
SAY CLEAR_CMD
EXIT
_| _ ' _|
… (_|/-\\/|(_|
SAY d2c(27)'c — how about this?'
–Jim
.. or even more elegant (and more obscure), try this on your command line:
rx "say d2c(7011)'How do you like this?'"
The value 7011 is equal to the charactrs ESC and 'c' packed together (ESC is
27, 'c' is 99, and 27*256+99 gives 7011). Not too readable, but does the job
compactly.
Of course, all this ESC stuff is for a console style window.
–Jim
Jim,
/* Say thank you to Jim */
DO 100
SAY " Thanks for your help"
SAY "it was exactly what I needed"
END
SAY d2c(7011)
_| _ ' _|
… (_|/-\\/|(_|