Thanks everyone for your replies.  I don't quite understand why the CP stage
works the way you have explained it, but I'll certainly remember that it
does.

On Tue, Jul 20, 2010 at 10:00 AM, Glenn Knickerbocker <n...@bestweb.net>wrote:

> On Tue, 20 Jul 2010 09:04:33 -0400, Mark Pace wrote:
>
> > 'PIPE var i | spec 1-* d2x 1-2 right | var j | cp q chpid ' j '| console'
>
> The value of J is being passed to the CP stage as an input record.  Most
> of the values aren't valid command names and so don't give any output.
> When you get to BA, BE, and EC, those are valid abbreviations of
> BACKSPACE, BEGIN (also no output), and ECHO.  You're lucky there isn't
> anything more destructive abbreviated by two hex digits!
>
> Also, did you notice that your queries start with an invalid one and only
> run to FE, not FF?  Pipelines can't do time travel.  You're building the
> Q CHPID command from the value of J *before* your pipeline is issued.
> Instead, you could use SPECS to build the command from the current value
> of I, and pass it to the CP stage as an input record.  Assuming you don't
> need the value of J for anything else:
>
>  'PIPE var i | specs "Q CHPID " 1 1-* d2x next | cp | console'
>
> And if you also don't need I for anything else, you can replace the whole
> loop with one pipeline:
>
>  'PIPE literal | dup 255 | specs "Q CHPID " 1 number from 0 d2x next | cp
>  | console'
>
> ¬R      Blood is worthless, outside its original container.
> http://users.bestweb.net/~notr/davidcar.html     --Don Rauf
>

Reply via email to