In that case why not use the standard RxQueue?

  'DIR  | RxQueue'
   do i=1 to queued()
    say i '-' linein("QUEUE:")
  end

Ruurd


On 7-2-2014 12:03, Roger Bilau wrote:
Hello Ruurd,

thank you for your fast answer.

Your example trap the trace output, but what I need is to trap the output
from a Windows Shell command e.g.

/*REXX*/

"C:"

"CD /"

"DIR"

Exit

I know there are other ways to change directory or read a directory but this
is only an example.

I tested it also with the .output monitor, but got not the needed result.

Regards

Roger

Von: Ruurd Idenburg [mailto:[email protected]]
Gesendet: Freitag, 7. Februar 2014 10:21
An: Open Object Rexx Users
Betreff: Re: [Oorexx-users] How to redirect DOS command messages to a stem
variable (or an array)?

This example might help:

    out.0 = 0   -- create the stem
   pdest = .error~destination(.trapout~new(out.))  -- redirect .error output
to the stem
   trace i   -- trace output goes to .error
   a = 1
   b = 2
   c = a+b
   trace o   -- end the trace
   do s=1 to out.0   -- display trace output
     say out.s
   end
   .error~destination  -- back to normal destination for .error
   exit
::class trapout public

::method init
   expose stem
   use arg stem

::method unknown
   expose stem
   use arg msg, text
   stem[0] += 1
   index = stem[0]
   stem[index] = text~makeString

On 7-2-2014 7:56, Roger Bilau wrote:

Hello,
on the mainframe it is possible to trap the messages from a TSO command to a
stem variable with the outtrap command.
On DOS I could redirect the messages with '>' to a file, but it would be
much more comfortable if there is a similary way.
I read the information about .stderr, .stdin, .stdout in the rexx reference
guide, but didn't really understand it and couldn't
found samples, to get closer. If it is possible, short sample code would be helpful. Regards Roger





----------------------------------------------------------------------------
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231
<http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktr
k> &iu=/4140/ostg.clktrk






_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users








------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk


_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users


--
Ruurd Idenburg

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to