skippynz Posted March 1, 2006 Share Posted March 1, 2006 hi guys can you tell me why i get this error ": ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: " in SciTe when running this ?? im sure it use to work before i updated to the latest Beta. For $x = 1 To $responding_1[0] $responding_1a = StringStripCR($responding_1[$x]) If $responding_1a <> '' Then FileWriteLine(@ScriptDir & "\checks.txt", $responding_1a) EndIf Next Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 1, 2006 Moderators Share Posted March 1, 2006 Try this and see how many elements $responding_1 is holding::MsgBox(0, 'Element Test', 'Number of elements found for this array: ' & Ubound($responding_1) - 1)Use this in place of the For/Next loop Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
skippynz Posted March 1, 2006 Author Share Posted March 1, 2006 (edited) Try this and see how many elements $responding_1 is holding::MsgBox(0, 'Element Test', 'Number of elements found for this array: ' & Ubound($responding_1) - 1)Use this in place of the For/Next loop says there are 25 elements. to make it clear its failing on this line $responding_1a = StringStripCR($responding_1[$x]) Edited March 1, 2006 by craig.gill Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 1, 2006 Moderators Share Posted March 1, 2006 It's not failing on that line for me, it's not even making it to the loop, so $responding[0] is the issue.... Try this:Dim $responding_1[2] $responding_1[1] = 'This is a test' & @CR & 'And only a test' MsgBox(0, UBound($responding_1) - 1, $responding_1[1]) For $x = 1 To UBound($responding_1) - 1 MsgBox(0, '', $responding_1[$x]) $responding_1a = StringStripCR($responding_1[$x]) If $responding_1a <> '' Then ConsoleWrite($responding_1a);FileWriteLine(@ScriptDir & "\checks.txt", $responding_1a) EndIf Next Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
skippynz Posted March 1, 2006 Author Share Posted March 1, 2006 (edited) It's not failing on that line for me, it's not even making it to the loop, so $responding[0] is the issue.... Try this:Dim $responding_1[2] $responding_1[1] = 'This is a test' & @CR & 'And only a test' MsgBox(0, UBound($responding_1) - 1, $responding_1[1]) For $x = 1 To UBound($responding_1) - 1 MsgBox(0, '', $responding_1[$x]) $responding_1a = StringStripCR($responding_1[$x]) If $responding_1a <> '' Then ConsoleWrite($responding_1a);FileWriteLine(@ScriptDir & "\checks.txt", $responding_1a) EndIf Next so i should be using UBound($responding_1) - 1 instead of $responding_1[$x]) on the For $x = 1 to line ? is that right ? Edited March 1, 2006 by craig.gill Link to comment Share on other sites More sharing options...
skippynz Posted March 1, 2006 Author Share Posted March 1, 2006 so i should be using UBound($responding_1) - 1 instead of $responding_1[$x]) on the For $x = 1 to line ? is that right ? ok just tested and worked a treat... thanks for that SmOke_N your help is appreciated. 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