On Thu 8/7/2008 4:25 PM Kris Buelens said:

> And, if you insist on using the stack (no problem for me), change to
> code to loop the number of lines stacked by EXECIO and not the number
> of files you seem to know.  Between getting the number of files and
> the EXECIO Q RDR, RDR files might be removed (a new VM READ follows)
> or an extra file might arrive (and your exec leaves one stacked line
> behind.  So:
>  "MAKEBUF"
>  b4 = queued()
>  BuffSize=(reader_files + 10)*81
>  "EXECIO * CP (BUFFER' buffSize 'STRING Q RDR * ALL"
>
>  Do queued() - B4
>   .....
>  End

Prior to PIPES we all had to use the stack at some time or other. :-(

The first thing I would recommend is to include a "DROPBUF" at the end.
Specifically,
"MAKEBUF"
buffer = rc
<code to move stuff into and out of the stack>
"DROPBUF" buffer

I also wrote an assembler REXX function that works like the "queued()"
built-in function, except it returns the number of entries stacked since
the last "MAKEBUF", called "buffered()". So the above example would look
like:
"MAKEBUF"
buffer = rc
"EXECIO * CP (BUFFER' buffSize 'STRING Q RDR * ALL"
Do buffered()
 .....
End
"DROPBUF" buffer

It's a 120-line assembler program, if anyone is interested.

Best regards,

Mark L. Wheeler
IT Infrastructure, 3M Center B224-4N-20, St Paul MN 55144
Tel:  (651) 733-4355, Fax:  (651) 736-7689
mlwheeler at mmm.com
--
"I have this theory that if one person can go out of their way to show
compassion then it will start a chain reaction of the same. People will
never know how far a little kindness can go." Rachel Joy Scott

Reply via email to