Jump to content

help please


Recommended Posts

I was wondering if i could RunWait from one compiled .exe program to another one of my compiled .exe programs and carry over the variables to the other program

I think when you run the second script it will start in it's own environment, blissfully unaware of any variables set in the first script. You could, however, pass variables as command line arguments, or you could write required data to a file and pass that.

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

Look at Command Line Parameters / Envset / Envget in the help file.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Two files (parent and child).... run Parent.au3

parent.au3

EnvSet("foo", "There is a maximum length, possibly 255 characters for this type of variable...")

; The following would probably be replaced with RunWait("child.exe") once compiled...
RunWait(@AutoItExe & " " & "child.au3" & " " & "commandLineArg1 aSecondCommandLineArg")

child.au3

MsgBox(4096,"Foo is", EnvGet("foo"))

If $CmdLine[0] > 0 Then
    For $i = 1 to $CmdLine[0]
    MsgBox(4096,"Arg #" & $i & " is", $CmdLine[$i])
    Next
EndIf

If you have a bunch of variables or if you use arrays, you'll need to look at FileWrite / FileRead or FileReadLine / FileWriteLine. Help file has examples for those functions.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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...