iceberg Posted October 12, 2005 Posted October 12, 2005 Hi, Why doesn't this work? Pls help me. AutoItSetOption("TrayIconHide", 1) $t = FileGetTime("D:\Test.txt", 0) $s = FileGetTime("C:\Test.txt", 0) If $s > $t Then Filecopy("c:\test.txt", "d:\test.txt", 1) EndIf Thanks. mouse not found....scroll any mouse to continue.
Valuater Posted October 12, 2005 Posted October 12, 2005 because FileGetTime() returns an array, and you are not checking the array values Try this to see the values AutoItSetOption("TrayIconHide", 1) $t = FileGetTime("D:\Test.txt", 0) $s = FileGetTime("C:\Test.txt", 0) If $s > $t Then Filecopy("c:\test.txt", "d:\test.txt", 1) EndIf For $x = 1 to $t[0] MsgBox(0,"test", $t[$x] & " " & $s[$x] ) Next 8)
iceberg Posted October 12, 2005 Author Posted October 12, 2005 Hi, thanks for highlighting. but i got an error Line 10: MsgBox(0,"test", $t[$x] & " " & $s[$x] ) MsgBox(0,"test", ^ERROR Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded. Thanks. mouse not found....scroll any mouse to continue.
Valuater Posted October 12, 2005 Posted October 12, 2005 $t = FileGetTime("D:\Test.txt", 0) $s = FileGetTime("C:\Test.txt", 0) If $s > $t Then Filecopy("c:\test.txt", "d:\test.txt", 1) EndIf For $x = 1 to 5 MsgBox(0,"test", $t[$x] & " " & $s[$x] ) Next . that will work...its the idea ... not the actual code above have you tried FileGetSize() ; no array needed FileGetVersion ; no array needed ??? 8)
iceberg Posted October 12, 2005 Author Posted October 12, 2005 (edited) thanks Valuater, the FileGetSize solved my problem! Edited October 12, 2005 by iceberg mouse not found....scroll any mouse to continue.
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