The following assumes that \ can never occur in the data stored in
variable Fred.

        "pipe .... | specs \"Fred"\ 1 ... | ..."

The canonical way to handle data in a REXX variable in a delimiter
independent manner is:

        "pipe .... | specs x"c2x(Fred)" 1 ... | ..."

There are some minor deficiencies here:

        1 - Even the most diligent programmers will be tempted to skip
this more verbose form when they "think" that they have a data safe
delimiter.  Alas, they may be wrong, and requirements may change.

        2 - The data is unnecessarily converted to hex and then parsed
and converted back by pipes.  If the string  were very large, CPU usage
and working set might show minor up ticks.

        3 - It's not always obvious to the novice why the apparently
unnecessary conversions are being done.

I propose the following equivalent:

        "pipe .... | specs var Fred 1 ... | ..."

That, in turn, suggests the following:

        "pipe .... | specs 1-10 var Fred ... | ...",

which would store the first ten chars of the record in the variable
Fred.

Whether or not "TRACKING" behavior is appropriate is left as an exercise
for the readers.  Hint:  Would you want to be able to pass information
from one stream to another using 'var'?

My apologies if this has been proposed before.

Reply via email to