🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #1003

Re: ARexx help

#1003
From: Mike (I'll think of something ye...
Date: Fri, 25 Aug 1989 00:56
73 lines
3510 bytes
In article <22442@louie.udel.EDU> new@udel.EDU (Darren New) writes:
<I would think this should be simple, but maybe I'm missing something.
<I want to be able to say
<
<1> cd sys:xyz/pdq
<1> rx hello
<SYS:xyz/pdq
<1>
<
<Where hello.rexx contains something along the lines of:
</* hello.rexx */
<address command
<'cd'
<
<However, it seems as though SYS: is the current dir for all the
<commands I start from ARexx.  What am I doing wrong?
<Thanks in advance.     -- Darren

Similar questions come up regularly on AREXX-L (The bitnet ARexx
discussion list), so I suspect the following may be of interest to the
net at large.

First off, I'm not quite sure what the question is. If I create a
"hello.rexx" that does basically what you do, it works like you want
it to - hello does the same things as a bare cd command, in any of
WShell, AmigaShell and the CLI. If you're using something else, that
could be the problem.

The first thing to note is that there are two "current directories"
associated with a running ARexx script (usually, anyway). One is the
current directory of the client program that invoked the script. The
other is the current directory of the script itself - which is
inherited from the client program if that has one, or from the rexx
server if the client doesn't have one. I'm going to ignore the latter
case.

Even though they start the same, they can be changed independently. To
change the current directory of the ARexx script, you use the
directory pragma, like so:

say pragma('Directory')		/* Reports current directory */
say pragma('Directory', 'sys:')	/* Reports current, then changes to sys: */
call pragma('D', 'c:')		/* Change to c: */
say pragma('d', 's:')		/* report current, change to s: */

How you change the clients current directory will depend on the
client. You issue the command to it that you would issue interactively
to change the directory. For instance:

WShell:		'cd sys:'		/* Change to sys: */
		'cd' directory		/* Change to name in directory */

Unfortunately, the only other client I have that lets you change
directories is mg3a, which uses the exact same syntax. Oh well, you
should get the idea.

Finally, if you're running ARexx via rx and sending commands to the
command address, you don't have a real client. What you have is the
ability to do an Execute. These commands get their current working
directoryt from the ARexx script. As stated above, the directory
pragma lets you change that to start those commands in an arbitrary
directory.

	<mike

Version notes: I'm using 1.10. Since it's much faster, and the upgrade
is $5, I recommend it to _everybody_. Some of the above has changed in
the past, but shouldn't be noticably in most scripts.
--
He was your reason for living				Mike Meyer
So you once said					mwm@berkeley.edu
Now your reason for living				ucbvax!mwm
Has left you half dead					mwm@ucbjade.BITNET
Technical Details
Message-ID: <1989Aug25.005606.26827@agate.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!brutus.cs.uiuc.edu!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwm
References: <22442@louie.udel.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!brutus.cs.uiuc.edu!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwm
From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer)
Newsgroups: comp.sys.amiga.tech
Subject: Re: ARexx help
Message-ID: <1989Aug25.005606.26827@agate.berkeley.edu>
Date: 25 Aug 89 00:56:06 GMT
References: <22442@louie.udel.EDU>
Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44)
Reply-To: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer)
Organization: Missionaria Phonibalonica
Lines: 73