| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | More REXX... |
Mike Ruskai wrote the following to All on 07-20-1994 regarding More
REXX...:
MR> I would like to redirect the output of the SAY command to a text
MR> file which is referred to, but I do not know how to redirect the
MR> SAY command. The online REXX Information only says that the
MR> "standard" rules for redirection apply to the SAY command. Well,
MR> standard rules as far as I know include using > and >>,
which translate into a bad arithmetic attempt and the
MR> characters >> being printed when SAY encounters them. So, how do
MR> I redirect the output of SAY to a file? Or anything other than
MR> STDOUT.
You are misusing the term "redirection". What you really want to do
is simply *write* to a specific file. Use Lineout for that, i.e.
instead of
say "The following icons must be renamed."
use the command
call lineout 'checking.txt', "The following icons must be renamed"
if you want to write to the file 'checking.txt'.
The statement that "standard" rules for redirection apply to the SAY
command means that if a Rexx program is executed with redirection, as
when you type the command
myrexx.cmd > output.txt
on the command line, then any Say commands within myrexx.cmd will be
redirected to the file output.txt. You can redirect OS/2 commands
inside the REXX program (as you did with the dir command), but you can
only redirect Rexx commands like Say from outside, e.g. on the command
line.
MR> Beyond that, is there a way to check an individual filename for
MR> the presence of a bad character so that it could be checked upon
MR> the conversion of each icon file? Doing a directory listing of a
MR> couple thousand icons even on my 486DX2/66 isn't a fun wait. I
MR> would like to have it check each icon just before processing, and
MR> if it contains a bad character (actually only the & since it is the
MR> only bad character unique to OS/2, not DOS) move it to a directory
MR> and notify the user that there are icons there that need to be
MR> renamed.
If you have an icon name in the variable "iconname", just use
something like
If Pos( "&", iconname) > 0 Then /* name contains
"&" character */
If you want to check for any one of a list of bad characters,
investigate the Verify function. You might want to look at SysFileTree
as a means of getting a list of names.
If you are really interested in the names that appear beneath desktop
icons, then you have to get the "long name", which is stored in the
Extended Attributes.
rc = SysGetEA( filename, ".LONGNAME", "LNAME")
will put the file's long name in variable "lname". If rc is nonzero,
it failed.
--- Russ Williams ---
___ Green Valley, AZ ---
---
X KWQ/2 1.2e X Funny, only sensible people agree with me.
--- Maximus/2 2.01wb
* Origin: The Emerald Isle, Tucson, Az. (602) 749-8638 (1:300/14)SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 413 430 SEEN-BY: 711/807 808 809 934 942 712/353 623 713/888 800/1 @PATH: 300/14 406 15 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.