frankzappa Posted March 29, 2008 Posted March 29, 2008 hey all, i'm trying to use FileGetTime in a bot but i'm stuck in this error: CODE$temp = FileFindNextFile($search) $d = FileGetTime($temp) $date = $d[0] & $d[1] & $d[2] & $d[3] & $d[4] & $d[5] the error i got is the following: ==> Subscript used with non-Array variable.: $date = $d[0] & $d[1] & $d[2] & $d[3] & $d[4] & $d[5] $date = $d^ ERROR Can someone help me? thanks from the newbie...
cppman Posted March 29, 2008 Posted March 29, 2008 First make sure the file exists(or check for an error with FileGetTime). #include <array.au3> Global $sFilePath = "H:\Windows\Greenstone.bmp" $vDate = FileGetTime($sFilePath) if (not @error) Then _ArrayDisplay($vDate) EndIf Miva OS Project
weaponx Posted March 29, 2008 Posted March 29, 2008 FileGetTime() needs the full path to the file, which would be the path used for FileFindFirstFile(). $path = "C:\" $search = FileFindFirstFile($path....) . . . $temp = FileFindNextFile($search) $d = FileGetTime($path & $temp) $date = $d[0] & $d[1] & $d[2] & $d[3] & $d[4] & $d[5]
frankzappa Posted March 29, 2008 Author Posted March 29, 2008 The problem was in the path, as Wolverine said. FileFindFisrtFile doesn't return the hole file name with the path, you have to add it by yourself. Thanks!
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