Burgs Posted January 15, 2018 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
iamtheky Posted January 15, 2018 Posted January 15, 2018 this? #include<array.au3> Global $_SAVED_PIX[1][2] = [[-1, -1]] _ArrayDisplay($_SAVED_PIX) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
water Posted January 15, 2018 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Burgs Posted January 16, 2018 Author Posted January 16, 2018 Hmm...OK thanks you for the explanation...I guess that makes sense. Thanks for clearing up my confusion, regards
iamtheky Posted January 16, 2018 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... ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
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