Jump to content
Sign in to follow this  
iceberg

FileCopy New Files

Recommended Posts

iceberg

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.

Share this post


Link to post
Share on other sites
Valuater

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

Share this post


Link to post
Share on other sites
iceberg

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.

Share this post


Link to post
Share on other sites
Valuater

$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

Share this post


Link to post
Share on other sites
iceberg

thanks Valuater,

the FileGetSize solved my problem!

Edited by iceberg

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

Share this post


Link to post
Share on other sites
Valuater

Glad I could Help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×