[comp.sys.amiga.tech] AREXX technical question

rouaix@fitou.uucp (Francois Rouaix) (10/12/89)

Here is a "technical" question about AREXX. I post is here instead of
comp.lang.rexx since it may be Amiga dependent. 
If  you're not familiar with AREXX interfacing,  you might want to skip 
the rest of the article...

When you write an AREXX interface for some application (let say
with minrexx for example), you have the choice between using commands 
and functions. The difference for the user is schematically

For a command host:
address 'myhostportname' 'cmd' par1 par2 ... parn
(eventually with option results if you want a result)

For a function host:
1> rxlib cmdhost
and in scripts
res=cmd(par1,par2,...,parn)

The host may be considered both as a command host, or a function host,
provided it looks at flags RX_COMM / RX_FUNC in the messages, and treats
parameters in the appropriate way (ie all parameters in one string
for commands, and a parameter per string in function calls).

The problem I have is that I can't get error codes when I use
function calls.
When  using commands, it's easy to return the rexx msg with the primary
and secondary error codes, so that the script might look at 
the rc variable to handle the error.
However, when I use functions, rx produces an error
"error in external function" (i don't have the exact reference here)
and I didn't find a way to get some information on what error occurred.
My question is: is it possible, and how should i do this ?

Thanks for your help
--Francois

PS: i'll tell you the reason i have for using functions instead of
commands. suppose  one of your parameters is an amigados file name.
It may contain almost any character, in particular spaces.
In command mode, since all parameters are in the same string, it is not
possible to extract the exact file name without using a quoting mechanism,
which is tedious.....
(Auxiliary question: do we have a character that may *never* appear
in an amigados filename ?)

*- Francois Rouaix                 //       We are all prisoners here,       *
*- rouaix@inria.inria.fr         \X/           of our own device             *
*- SYSOP of Sgt. Flam's Lonely Amigas Club. (33) (1) 39-55-84-59 (Videotex)  *
Disclaimer: Opinions expressed are my own, not those of my employer.

mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) (10/13/89)

In article <280@seti.inria.fr> rouaix@inria.inria.fr (Francois Rouaix) writes:
<Here is a "technical" question about AREXX. I post is here instead of
<comp.lang.rexx since it may be Amiga dependent. 
<The problem I have is that I can't get error codes when I use
<function calls.
<My question is: is it possible, and how should i do this ?

There isn't any way to do what you want. You can choose one of
multiple arguments (function) or two return values (command), but not
both.  I talked to Bill Hawes about it, and it may appear in the next
version. Call him and nudge him yourself if it really concerns you.
(Don't if it doesn't, though, as he's pretty busy.)

	<mike
--
So this is where the future lies			Mike Meyer
In a beer gut belly; In an open fly			mwm@berkeley.edu
Brilcreamed, acrylic, mindless boys			ucbvax!mwm
Punching, kicking, making noise				mwm@ucbjade.BITNET

ccplumb@rose.waterloo.edu (Colin Plumb) (10/14/89)

In article <280@seti.inria.fr> rouaix@inria.inria.fr (Francois Rouaix) writes:
> (Auxiliary question: do we have a character that may *never* appear
> in an amigados filename ?)

There is exactly one character, the forward slash.  It has a special
meaning to pathnames, so is never part of a file name.  Colons seem
to be treated as ordinary characters after the first (type funny:file
chokes, but type df0:funny:file works), and you need to go all the
way down to building your own packets to get an ASCII null '\0', but
255 out of the 256 possible 8-bit bytes can appear in the FileInfoBlock
returned by Examine() without having to use a disk editor.
-- 
	-Colin