qaravi 0 Posted October 15, 2007 how can i solve the following error? Array variable has incorrect number of subscripts or subscript dimension range exceeded.: did i make mistake in declaring the array thanks in advance ravi_qa Share this post Link to post Share on other sites
GaryFrost 18 Posted October 15, 2007 how can i solve the following error? Array variable has incorrect number of subscripts or subscript dimension range exceeded.: did i make mistake in declaring the arraythanks in advanceravi_qaCrystal ball says: "Maybe"Hard to say where the mistake is with out a script to look at. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Share this post Link to post Share on other sites
SadBunny 131 Posted October 15, 2007 how can i solve the following error? Array variable has incorrect number of subscripts or subscript dimension range exceeded.: did i make mistake in declaring the array thanks in advance ravi_qa This error means you are trying to access an array element that has not been created (yet). For instance, when you Dim $a[10] and then try to ConsoleWrite($a[10]) (or even higher than 10 ofcourse), you will get that error message. Important to know is that Dim $a[10] created an array $a with EXACTLY TEN elements, running from ZERO to NINE. Meaning: there is NO tenth element in this case; you would need an array with 11 elements for that. This concept is called 0-based arrays (also called the 0-beast), and confusion about it is 9 out of 10 times the reason for this error. Roses are FF0000, violets are 0000FF... All my base are belong to you. Share this post Link to post Share on other sites
wolf9228 70 Posted October 15, 2007 how can i solve the following error? Array variable has incorrect number of subscripts or subscript dimension range exceeded.: did i make mistake in declaring the array thanks in advance ravi_qa #include <Array.au3> dim $avArray[1] _ArrayDisplay($avArray, "_ArrayDisplay() Test") $sValue = 1 ReDim $avArray[UBound($avArray) + 1] $avArray[UBound($avArray) - 1] = $sValue _ArrayDisplay($avArray, "_ArrayDisplay() Test") $sValue = 2 ReDim $avArray[UBound($avArray) + 1] $avArray[UBound($avArray) - 1] = $sValue _ArrayDisplay($avArray, "_ArrayDisplay() Test") $sValue = 3 ReDim $avArray[UBound($avArray) + 1] $avArray[UBound($avArray) - 1] = $sValue _ArrayDisplay($avArray, "_ArrayDisplay() Test") $sValue = 4 ReDim $avArray[UBound($avArray) + 1] $avArray[UBound($avArray) - 1] = $sValue _ArrayDisplay($avArray, "_ArrayDisplay() Test") صرح السماء كان هنا Share this post Link to post Share on other sites