My problem:

* * * Top of File * * *
/* Rexx */ signal on novalue;  /*
   Doc: Experiment in reusing streams.
*/
trace Err
'addstream  input A'

/* This is adapted from the Journeyman Plumber Exam,
   and works as I'd expect:
*/
say; say 'Direct input:'
do I = 1 to 5
    'addpipe literal +0.5' I '| delay | *.input.A:'
    'callpipe *.input.A: | take 1 | specs /read: / 1 1-* next | console'
    'select input A'
    'sever input'  /* Unstack to previous connection.  */
    end I

/* Now, I'd like to get fancy and use multiple streams.  But
   I'll start with one.  However, it fails with:

       PIPSSU139E No connection available to redefine for *.input.A.

   How do I use multiple dynamic streams?
*/
'addstream  input B'
'addstream  input C'
'addpipe *.input.C: | faninany | *.input.B:'
say; say 'Input via faninany:'
do I = 1 to 5
    'addpipe literal +0.5' I 'fan | delay | *.input.C:'
    'callpipe *.input.B: | take 1 | specs /read: / 1 1-* next | console'
    'select input C'
    'sever input'  /* Unstack to previous connection.  */
    end I
* * * End of File * * *

Thanks,
gil

Reply via email to