brodie28 Posted August 26, 2006 Share Posted August 26, 2006 I am using the string split function to create an array from a string. $commands = StringSplit ( $command, " ", 1) It works fine, but in my other functions when I try to use this array I get an error for using a variable before it is declared. I tried this but it did not fix it. global $commands = StringSplit ( $command, " ", 1) Any ideas? I know the solution will be really simple, but oh well.... Link to comment Share on other sites More sharing options...
amanda089 Posted August 26, 2006 Share Posted August 26, 2006 Put Global $commands at the top of your script, and use your first code example to define/redefine the variable. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 26, 2006 Moderators Share Posted August 26, 2006 Is $command already global? If not, you're trying to use it in a local scope within a function, and the value isn't passed. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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