Jump to content

Question on function OnAutoItStart()


 Share

Recommended Posts

  • Developers

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

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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"

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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