ZebrasInBlankets Posted May 23, 2005 Share Posted May 23, 2005 (edited) expandcollapse popup#include <File.au3> HotkeySet("!1", "testdb") while 1 sleep(100) wend Func testDB() $num_id = 12345 $in_filename = "test.csv" Dim $lines,$Display, $NumCols _FileReadToArray($in_filename, $lines) $Columns = StringSplit($lines[1], ",") $NumCols=$Columns[0] Dim $array[ $lines[0] ][ $Columns[0] ] For $i = 1 To $lines[0] $Columns = StringSplit($lines[$i], ",") If $Columns[0] = 1 Then Continueloop For $j = 1 To $Columns[0] $array[$i-1][$j-1] = $Columns[$j] Next Next $Rows=$Lines[0]-1 $p = 1 while 1 if $array[$p][0] = $num_id then if $array[$p][2] = "1" then DoIt() else Send("{ESC}") endif exitloop else $p = $p + 1 ContinueLoop endif wend EndFunc Func DoIt() Sleep(2500) Send("{F8}") EndFunc Why do I keep getting this error? Array variable has incorrect number of subscripts or subscript dimension range exceeded.: if $array[$p][0] = $num_id then if ^ ERROR Edited May 23, 2005 by ZebrasInBlankets Link to comment Share on other sites More sharing options...
/dev/null Posted May 23, 2005 Share Posted May 23, 2005 Why do I keep getting this error?Array variable has incorrect number of subscripts or subscript dimension range exceeded.: if $array[$p][0] = $num_id thenBecause you don't check if $p gets larger than $lines[0], which you used to DIM $array. Print $lines[0] and $p for each iteration of your loop and you'll most probably see that at the end $p becomes $lines[0]+1, which will trigger the error message.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * 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