Jump to content
Sign in to follow this  

StdoutRead + ConsoleWrite works but ArrayAdd does not

Recommended Posts

As the title suggests. I am trying to write the data from a command prompt to an array... in the console the results are listed perfectly but in the array it is not. Any suggestions?

#include <Constants.au3>
#include <Array.au3>

Dim $run, $results, $array[1]

$run = Run(@ComSpec & " /c dir c:\windows\*.exe /b", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

While 1
    $results = StdoutRead($run)
    If @error Then ExitLoop
    _ArrayAdd($array, $results)



Share this post

Link to post
Share on other sites

I'm not sure how to explain what you are doing wrong, but here's the code to do it right.

haha i love this line... i want to pin this up at work :x

thanks this has worked perfectly!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...