Jump to content
Sign in to follow this  
FreeSiker

Question on function OnAutoItStart()

Recommended Posts

You will have to define all needed vars in the Func itself:

Func OnAutoItStart()
    Global $test = "hello"
    MsgBox(0, "test", $test)
EndFunc  ;==>OnAutoItStart

Share this post


Link to post
Share on other sites

You will have to define all needed vars in the Func itself:

Func OnAutoItStart()
    Global $test = "hello"
    MsgBox(0, "test", $test)
EndFunc ;==>OnAutoItStart
I know but the variable is not realy usable by the rest of the script

Func OnAutoItStart()
    Global $test = "hello"
    MsgBox(0, "test", $test)
EndFunc  ;==>OnAutoItStart

Func OnAutoItExit()
    MsgBox(0, "test", $test)
EndFunc   ;==>OnAutoItExit

Result:

C:\help post.au3(7,28) : WARNING: $test: possibly used before declaration. MsgBox(0, "test", $test)

C:\help post.au3(2,27) : WARNING: $test: declared global in function only. Prefer top of file. Global $test = "hello"

Share this post


Link to post
Share on other sites

Its works fine... AU3Check gets confused but its works fine when you ignore the warnings .

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  

×
×
  • Create New...