On Mon, 13 Jul 2009 18:54:04 -0500, Ian wrote:
>Redirecting the fanout via ?dup0:|add0:  was the bit I was missing.  I often
>seem to stumble on that occasional requirement:  is there any guidance
>anywhere about when its required and when its not, and how to do it right?

The important thing to remember is, if you need a record to go two places
in a pipeline, you need to use FANOUT to make two copies of it.

Where you have this:

   '?0000:',     /* output 1 of NLOCATE */
     '|     >' fn '  start000'  ofm,  
     '|l2:',     /* input 1 of LOOKUP */ 

">" copies the record *outside* the pipeline, and then sends the record
on to the next stage.  Other device drivers like VAR and STACK do the
same thing.

I'm guessing this is where you might have tried to send the records to
two places *in* the pipeline, maybe like so:

   '?0000:',     /* output 1 of NLOCATE */
     '|nstart:', /* input 2 & output 2 of FANINANY */
     '|l2:',     /* input 1 of LOOKUP */ 

But FANINANY never makes any new copies of records.  It reads records
from all its inputs, and writes them to only its primary output.  Even if
it didn't give you an error message saying not to connect unused output
2, the fragment above would never pass any records to input 1 of LOOKUP,
because FANINANY never writes anything to its alternate outputs.

Or maybe you realized you needed a FANOUT, but you tried to reuse the
same label to connect it:

   '?0000:',     /* output 1 of NLOCATE */
     '|nstart: fanout',
     '|l2:',     /* input 1 of LOOKUP */ 

In this case, you need to remember that a label names a stage, not a
connection point.  nstart: names your FANINANY stage, and each occurrence
of that label names an input and an output of it.  The FANOUT needs its
own separate label, and then you need to connect an output of it to an
input of FANINANY.

¬R  "I love Blip just because it's the absolute opposite of fun"
http://users.bestweb.net/~notr/travelog/19990710.html     --Kibo

Reply via email to