Sign in to follow this  
Followers 0
Brogsitter

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

6 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Try EnvGet and EnvSet if it's what you're looking for.... I don't know about any sort of export like in C in AutoIt ;]

Share this post


Link to post
Share on other sites

Sorry, but I havent found something with the search engine. Probably I am blind or just too stupid.

Share this post


Link to post
Share on other sites

Try EnvGet and EnvSet if it's what you're looking for.... I don't know about any sort of export like in C in AutoIt ;]

This sounds good, I will give it a try and keep you informed if it is working or not. Thanks

Share this post


Link to post
Share on other sites

Try EnvGet and EnvSet if it's what you're looking for.... I don't know about any sort of export like in C in AutoIt ;]

Well here is my report: works fine! I have to alter alot of code now but.... it works. Thank you very much for this hint!

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  
Followers 0