Adriaan Posted June 23, 2006 Share Posted June 23, 2006 I want to fill a 2 dimensional array with the array get from FileGetTime(with Format=array) i've declared a 2 dimensional array Dim $JobTimeArray[4][6] ;FilegetTime gives a 6 element array Do If FileExists(@WindowsDir&"\Tasks\"& $JobName & $AS_array[$t] & ".job")=1 Then $JobTimeArray[$Nsch]=FileGetTime(@WindowsDir&"\Tasks\"& $JobName & $AS_array[$t] & ".job",0,0) $Nsch=$Nsch+1 EndIf $t=$t+1 Until $t=4 Compilation keeps giving: Array variable has incorrect number of subscripts or subscript dimension range exceeded Also tried to use _AddArray but this probably only works with 1-dimensional arrays. What am i doing wrong? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 23, 2006 Moderators Share Posted June 23, 2006 Your only trying to get 1 element of the array... [$Nsch][Where/what is this element?] 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...
PsaltyDS Posted June 23, 2006 Share Posted June 23, 2006 I want to fill a 2 dimensional array with the array get from FileGetTime(with Format=array) i've declared a 2 dimensional array Dim $JobTimeArray[4][6] ;FilegetTime gives a 6 element array Do If FileExists(@WindowsDir&"\Tasks\"& $JobName & $AS_array[$t] & ".job")=1 Then $JobTimeArray[$Nsch]=FileGetTime(@WindowsDir&"\Tasks\"& $JobName & $AS_array[$t] & ".job",0,0) $Nsch=$Nsch+1 EndIf $t=$t+1 Until $t=4 Compilation keeps giving: Array variable has incorrect number of subscripts or subscript dimension range exceeded Also tried to use _AddArray but this probably only works with 1-dimensional arrays. What am i doing wrong? FileGetTime(), with your options, returns a 1D array, which you are trying to save to a 2D array: $FileTimeArray=FileGetTime(@WindowsDir&"\Tasks\"& $JobName & $AS_array[$t] & ".job",0,0) For $n = 0 To 5 $JobTimeArray[$Nsch][$n] = $FileTimeArray[$n] Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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