Jump to content

Variable for 'run command' changes to number


Recommended Posts

Don't ask what I'm trying to do, because this isn't it. I've just simplified the code so you can replicate the results.

#include <Constants.au3>
Local $Test = Run (@ComSpec & " /c dir, @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
MsgBox(0, 'WTF', $Test)

I thought the MsgBox would display the same contents I put in the variable but it doesn't. It displays just a number, that changes every run. 6180, 7316, 6604, etc. What's going on?

Ed

Edited by SystemWontAccept
Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

Don't ask what I'm trying to do, because this isn't it. I've just simplified the code so you can replicate the results.

#include <Constants.au3>
Local $Test = Run (@ComSpec & " /c dir, @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
MsgBox(0, 'WTF', $Test)

I thought the MsgBox would display the same contents I put in the variable but it doesn't. It displays just a number, that changes every run. 6180, 7316, 6604, etc. What's going on?

Ed

Congratulations on not making any sense at all.

The msgbox display exactly what the variable has, a PID (assuming you fix that obvious error).

You see, when you do this:

$SomeVariable = SomeFunction()

You save the return-value from that func! And what does the helpfile say Run() returns? The PID for the app runned, which happen to be a number.

So the msgbox DO display the content of the variable.

If this is not what you want to do, then you need to explain it to us. You may be a mind-reader, but we are certainly not :D

Edited by AdmiralAlkex
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...