Im trying to create a script to copy heaps of files at once to different directories.
I came up with the following script ( im a newb when it comes to KIX
)
Code:
for $i=0 to $Amount_of_Files
$Current = $i
$Current = ReadProfileString("Config.ini","Bestanden",$i)
$File_Array = Split($Current,",")
if Copy($File_Array(0),$File_Array(1)) = 0
? "Bestand gekopieerd:"+$File_Array(0)+" naar "+$File_Array(1)+"."
else
? "Fout opgetreden bij het kopieren van "+$File_Array(0)+" naar "+$File_Array(1)+"."
$Error_Count = $Error_Count+1
if Open( 3 , @LDRIVE + "\LOG.TXT" , 5 ) = 0
? "Logbestand gecreërd op:" +@LDRIVE+ "\Log.txt"
$x = WriteLine( 3 , "Script gestart op " +@DATE+ "om " + @TIME + @CRLF )
$x = WriteLine( 3 , "----------------------------" + @CRLF)
$x = WriteLine( 3 , "Fout bij kopieren van bestand: " + $File_Array(0) + " naar "+ $File_Array(1)+"."+ @CRLF
$NoErr = 0
Close(3)
else
BEEP
? "Er kon geen logbestand aangemaakt worden."
$NoErr = 1
endif
endif
$i=$i+1
next $i
The part that errors for me ( so far. theres more, without a doubt ) is the copy function.
Code:
if Copy($File_Array(0),$File_Array(1)) = 0
does kixscript support using arrays in this function or is there something else going on with this script?
Thanks!
-Jeroen