Jump to content

FileCopy New Files


iceberg
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

$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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...