Rad Posted July 27, 2006 Share Posted July 27, 2006 Au3 Example: If IsDeclared ("a") then MsgBox(0,"", "$a IS declared" ) ; due to previous $a=1 assignment EndIf Mine: If IsDeclared("WindowsMax") then MsgBox(0,"", "$WindowsMax IS declared" ) ; due to previous $a=1 assignment Else MsgBox(0,"", "$WindowsMax is NOT declared" ) ; due to previous $a=1 assignment EndIf $WindowsMax = $ii This is mainly to determine if the function has run yet, but I have a few other uses for IsDeclared I just discovered... but it doesnt work! Even if I run the function twice it doesnt work, whats wrong? It always says its not declared <,< Now that I read this below, I tried this: Success: Returns 1 for Global variable or variable declared outside functions. Special: -1 for Local variable. Failure: Return 0 when no variable can be found. $test = IsDeclared("WindowsMax") Msgbox(0,"test",$test) $WindowsMax = $ii Still only returns 0 >.> $ii works though Link to comment Share on other sites More sharing options...
OverloadUT Posted July 27, 2006 Share Posted July 27, 2006 In both of your examples, you're declaring the variable AFTER you call "IsDeclared" so it's functioning exactly as expected. If this just a snippit of your code? If it is, post the whole thing, or at least the entirety of an example so we can see. 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