swicks Posted November 14, 2008 Posted November 14, 2008 (edited) The code inside the "For i$..." runs fine without the outer loop. As soon as I place the "For i$..." code in place, SciTE throws the error "Array variable has incorrect number of subscripts or subscript dimension range exceeded.:" The only difference is the For...Next? Can someone help me with this? $startCol = 0 $startRow = 0 $c=0 $r=0 $i = 0 For $i = 1 to 10 If $aArray[1][$startCol+5] <> " " Then For $d = 1 to 10 If $aArray[$startRow + 2][$startCol+5] = "Yes" Then $bArray[$r][$c] = $aArray[1][$startCol+5] $bArray[$r][$c+1] = $aArray[$startRow + 2][4] ;get the Drive Letter $bArray[$r][$c+2] = $aArray[$startRow + 2][2] ;then get the Share Name $r=$r+1 $c=0 EndIf $StartRow=$StartRow+1 Next EndIf $startCol=$startCol+1 Next Edited November 14, 2008 by swicks
dbzfanatic Posted November 14, 2008 Posted November 14, 2008 Make sure you also declare $aArray as a multidimensional array. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
swicks Posted November 14, 2008 Author Posted November 14, 2008 Both arrays are dim'd as [12][15] arrays and the snippet works fine without the outer loop!
dbzfanatic Posted November 14, 2008 Posted November 14, 2008 Did you try Diming $i = 1? Sometimes things like that cause problems,sometimes they don't. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
swicks Posted November 14, 2008 Author Posted November 14, 2008 Yes, no joy :-( Also tried a "Do" loop. Seems this may be a problem. All these statements can be nested and the logic is only four deep.
Bowmore Posted November 14, 2008 Posted November 14, 2008 Both arrays are dim'd as [12][15] arrays and the snippet works fine without the outer loop! In your code $r will reach 100 thus exceeding maximum 11 for your arrays first dimention "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
swicks Posted November 15, 2008 Author Posted November 15, 2008 Good catch Bowmore, would have crossed this bridge later on $r. But the snippet that erroring was: "If $aArray[$startRow + 2][$startCol+5] = "Yes"" Found the error in not resetting the $startRow to 0 after the inner loop. Thanks very much for getting me started in the right direction!
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