ARexx (24/41)

From:Rolf Max Rotvel
Date:25 Aug 2000 at 10:54:16
Subject:Re: Unbalanced parentheses (not!)

Hi Andreas Mixich. You wrote:

> Thank you Rolf, it works !!! :-))) Yipeeee !

I'm glad it worked.

> However, what I do not understand is your usage of ':'. In my ARexx guide
> this character is reserved for indicating labels. I used '|' as string
> separator. Could you tell me more on that, please ?

Let's say you have a directory called sys:all and you want to list
that. 'List all' doesn't work because List thinks you've used the ALL
switch and lists every directory on sys:. But 'List "all"'
works because now the 'all' is quoted and recognized by List as a
string not a literal.

It's the same principle with the ' : '. It's simply a string (Or a
pattern if you like) that you want the PARSE command to look for. I
selected ' : ' because it's not possible to use this pattern in your
infile and tmpdir variables (Because they're both paths). If you don't
quote it (parse args in : tmp) you'll get a 'Invalid template' error.

You can use any pattern you like when parsing. And use variables:

sep = 'oa'
str = 'ooaa'
parse var str first (sep) last
say first ("o")
say last ("a")

Regards



Rolf Max Rotvel

ARexx mailing list - No flames, no overquoting, no crossposting. Unsubscribe: Blank mail to mailto:arexx-unsubscribe@onelist.com