Hello, everyone. I have created a new script based on one of the sample scripts on the website, which updates a list of files from another computer on the network. The script looks right to me, and I don't see any syntax errors, but when it is run I always get the following error:
Code:
Error: Missing "{".... --> 045: }
Here is the code. I have deconstructed it, made it more explicit, removed things, etc., but all to no avail. Can anyone tell me what is wrong with it?
Code:
;######################################################################################
; Copy only the source files that are newer than their counterparts in the destination
; Last updated 3/29/2007 10:44 AM
;######################################################################################
; This funtion calls the .ini file kept on Larry, which has a list of the scripts that
; should be updated. Changes to that list will not require this script to be updated.
GetItStarted:
inifilename = L:\Editing Resources\Perl\UpdateFilesFromLarry.ini
iniread, ArrayCount, %inifilename%, NumberOfFiles, ArrayCount
; This is the copying function. It loops through the files in the list...
CopyIfNewer:
numupdated = 0
UpdatedFileList = I did not update any files
Loop, %ArrayCount%
{
iniread, LarryFile, %inifilename%, LarryFiles, larryarray%A_Index%
iniread, LocalFile, %inifilename%, LocalFiles, localarray%A_Index%
copy_it = n
; If the file DOES NOT exist on the user's computer, it is flagged for copying
IfNotExist, %LocalFile% {
copy_it = y
} else {
; If the file DOES exist, the timestamps are compared
FileGetTime, localtime, %LocalFile%, M
FileGetTime, larrytime, %LarryFile%, M
EnvSub, localtime, larrytime, seconds ; Subtract the source file's time from the destination's.
if localtime < 0 ; Source file is newer than destination file.
copy_it = y
}
; Here, we copy the file if it needs to be copied and update a running list of new files
if(copy_it = y) {
FileCopy, %LarryFile%, %LocalFile%, 1 ; Copy with overwrite=yes
numupdated++
if(numupdated = 1) {
UpdatedFileList = I have updated these files:
}
SplitPath, LarryFile, UpdatedFile
UpdatedFileList = %UpdatedFileList% - %UpdatedFile%
if(ErrorLevel)
MsgBox, Could not copy "%LarryFile%" to "%LocalFile%".
}
}
; Last, we tell the user which files were updated
MsgBox, %UpdatedFileList%
Return