Jump to content

Handing Variables over to a "subscript"? I am lost


Recommended Posts

First of all:

Hello community! I am completly new to AutoIt, so please allow me some questions.

After searching the forums and helpfile, I was wondering if it is possible to handover variables from on script to another. Here is a snippet out of my script:

#include <ImageSearch.au3>
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------


; Define Variables
AutoItSetOption("MouseCoordMode", 0)

; Global
        $x1 = 0
        $y1 = 0
        $result = 0
        $bmpdir = "C:\_bmp\"

[[.... AND MUCH MORE variables]]

RunWait("GLOBAL_execute.exe")

RunWait("GLOBAL_switch.exe")

So I was wondering if it might be possible to use the defined variables in the scripts that will be called with the RunWait function without defining them again. I am not looking forward an #include due to the fact that I have the variables changing in different scripts. Any help will be apreciated.

Cheers

Brog

Link to comment
Share on other sites

First of all:

Hello community! I am completly new to AutoIt, so please allow me some questions.

After searching the forums and helpfile, I was wondering if it is possible to handover variables from on script to another. Here is a snippet out of my script:

#include <ImageSearch.au3>
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------


; Define Variables
AutoItSetOption("MouseCoordMode", 0)

; Global
        $x1 = 0
        $y1 = 0
        $result = 0
        $bmpdir = "C:\_bmp\"

[[.... AND MUCH MORE variables]]

RunWait("GLOBAL_execute.exe")

RunWait("GLOBAL_switch.exe")

So I was wondering if it might be possible to use the defined variables in the scripts that will be called with the RunWait function without defining them again. I am not looking forward an #include due to the fact that I have the variables changing in different scripts. Any help will be apreciated.

Cheers

Brog

You could put the data in an .ini file, or the registry, or use WM_COPYDATA messages, or TCP networking, or write data to the other script's GUI controls, etc., etc...

This topic is pretty well covered on the forum already. The search function is your friend.

:)

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

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...