AndyS01 Posted February 5, 2016 Share Posted February 5, 2016 I have a very large script and I found one of my global variables was declared twice but I didn't get any errors when compiling the script. I have a test script here: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Global $aArray1[7] Global $aArray1[7] ; I don't get an error on this line!! Global $aArray1[2] ; I don't get an error on this line!! global $VAR1 global $VAR2 global $VAR1 ; I get an error on this line global $VAR2 ; I get an error on this line I get "already declared/assigned" errors on the duplicate $VAR1 and $VAR2 lines but not on the duplicate $aArray1 lines. Is there a way to have the duplicate $aArray1 lines flagged with an error? Link to comment Share on other sites More sharing options...
jdelaney Posted February 5, 2016 Share Posted February 5, 2016 You can declare it a const: Global Const $array[5] Global Const $array[4] IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 5, 2016 Developers Share Posted February 5, 2016 My guess is that this isn't flagged for an Array as it is common to "reset" the array by re-declaring it. Jos 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 More sharing options...
AndyS01 Posted February 5, 2016 Author Share Posted February 5, 2016 I tried declaring them as Const, but then I got "previously declared as a 'Const'" errors when I compile the script. 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