Burgs Posted January 15, 2018 Share Posted January 15, 2018 Hello, OK and now for the simplest and dumbest question ever posted in this forum...I declare a 2 dimensional variable as so: Global $_SAVED_PIX[1][1] = [[-1], [-1]] As can be seen I'm trying to initialize the two elements with an initial value of "-1"...why does AutoIT give me an "Array variable has incorrect number of subscripts or subscript dimension range exceeded" error...???? What is wrong with that code...??? It seems to fit perfectly with the syntax outlined in the manual. Thanks in advance for any hint...regards Link to comment Share on other sites More sharing options...
iamtheky Posted January 15, 2018 Share Posted January 15, 2018 this? #include<array.au3> Global $_SAVED_PIX[1][2] = [[-1, -1]] _ArrayDisplay($_SAVED_PIX) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
water Posted January 15, 2018 Share Posted January 15, 2018 That’s because you created an array with one row and one column resulting in a single „cell“. But you try to initialize two „cells“. Hence the error My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Burgs Posted January 16, 2018 Author Share Posted January 16, 2018 Hmm...OK thanks you for the explanation...I guess that makes sense. Thanks for clearing up my confusion, regards Link to comment Share on other sites More sharing options...
iamtheky Posted January 16, 2018 Share Posted January 16, 2018 9 hours ago, Burgs said: guess that makes sense This is what you declared (fixing the # of rows) #include<array.au3> Global $_SAVED_PIX[2][1] = [[-1], [-1]] _ArrayDisplay($_SAVED_PIX) Which is a weird way to declare this: #include<array.au3> Global $_SAVED_PIX[2] = [-1, -1] _ArrayDisplay($_SAVED_PIX) and then post #2 is the 1 row 2 col solution... ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) 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