Not a how-to but a why-the-heck-not? inspired by current discussion on
the TSOREXX list. A time-honored way of swapping variables around is to
put them into an expression for PARSE:
Parse Value x y z With z x y
When the values aren't single words, we can play games with delimiters:
Parse Value x':'y':'z with z ':' x ':' y
But of course this depends on knowing a delimiter that will never occur
within your values. A simple and obvious extension to the PARSE syntax
that would eliminate the guessing games is for PARSE VALUE to take a
comma-separated list to be parsed with multiple templates like ARG:
Parse Value x, y, z With z, x, y
(I thought about extending PARSE VAR similarly but the syntax got less
obvious and it doesn't really provide any different function anyway.)
A less trivial extension would be to provide the result of allItems for
a single variable or expression starting in the second value:
Parse Var x. xdefault, x1, x2, x3, etc.
Parse Value f(x) With fclass, f1, f2, etc.
My "etc." above is just intended to represent any further combination of
templates, but it suggests another extension that's been wanted for a
long time even in the non-object world: Parse all the remaining values
into a stem. In Object Rexx, it could be any other collection object,
so the syntax could include the class:
Parse Value f(x) With fclass, .stem(f.)
For stems, this could include putting the count of items in stem.0, the
way some external programs (like EXECIO and PIPE on CMS) do. Missing
values should remain unassigned (and the count for the stem would be the
highest-numbered argument present rather than the number of items).
ŹR >@< >@< >@< >@< >@<
http://users.bestweb.net/~notr/chewy.html
I think you're telling me that, if you know the secret spells, you can
actually force Windows into behaving rationally. -- Rob Bannister