Jump to content

Recommended Posts

Posted

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.

Posted

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)

NEWHeader1.png

Posted

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.

Posted

$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)

NEWHeader1.png

Posted (edited)

thanks Valuater,

the FileGetSize solved my problem!

Edited by iceberg

mouse not found....scroll any mouse to continue.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...