DoctorX Posted October 14, 2005 Share Posted October 14, 2005 Here's a newbie-ish question, but I just ran into this problem: I have been in the habit of declaring local variables inside their respective function, for example: Global $Title = "Test" msgbox (0, $title, "About to enter the Example Function") ExampleFunc ("Example Function entered") Func ExampleFunc ($text) Local $text msgbox (0, $title, $text) EndFunc With the release version of AutoIT, this was never a problem, but when I compile it with the beta version $text causes a problem, I guess because I am essentialy re-declaring it. I assume this is just improper scripting etiquette on my part, and not a bug in the beta version. So should I instead be declaring all of my local variables at the very beginning of the script along with the global variables? Like I said, kind of a newbie question, but when you do something a certain way for a while and don't have problems, you don't realize you may be doing something wrong. -DRX Link to comment Share on other sites More sharing options...
w0uter Posted October 14, 2005 Share Posted October 14, 2005 $text is automaticly declared local here: Func ExampleFunc ($text) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
DoctorX Posted October 14, 2005 Author Share Posted October 14, 2005 Thank you! -DRX Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now