Im trying to allow the user to take a span of dates and copy log files from one folder to another so they can view them without disturbing the log process to the original files.
first do you have to create the destination file or will it create one if it DNE. Right now my code ensures the file exists by creating one before trying to copy to it.
second the documentation says filecopy() will run in multiple stages and after it begins the code will continue to execute. i think my code is running too fast to allow all the files to copy properly.(right now i dont even get the first file in the sequence to copy).
im wondering if there is a way to halt the execution of the script while i await a result of the of the filecopy() function.
DIM i AS INTEGER;
DIM ii AS MESSAGE;
DIM FirstSpace AS INTEGER;
DIM FileDate AS MESSAGE;
DIM monitor AS MESSAGE;
DIM result AS INTEGER;
IF DataLoggerDateNotValid==0 THEN
FOR i=0 TO DataLogSpan STEP 1
ii=StringFromIntg(i,10);
DataLoggerIndirectDate.Name="DataLoggerDate"+ii;
FirstSpace= StringInString( DataLoggerIndirectDate," ",1,0);
FileDate=StringReplace(StringTrim(StringLeft(DataLoggerIndirectDate,FirstSpace - 1),2),"/","_",0,-1,0);
FileWriteMessage ("C:\Users\Josh\Desktop\WonderWareDataLogger\DISPATCH_SCANNER_DETAILS\DISPATCH_"+FileDate+".csv", 0 , "",1); {Header Of FIle}
result=FileCopy("C:\WWtestFolder\DISPATCH_"+FileDate+".csv","C:\Users\Josh\Desktop\WonderWareDataLogger\DISPATCH_SCANNER_DETAILS\DISPATCH_"+FileDate+".csv" ,monitor); {Header Of FIle}
NEXT;
ENDIF;
first do you have to create the destination file or will it create one if it DNE. Right now my code ensures the file exists by creating one before trying to copy to it.
second the documentation says filecopy() will run in multiple stages and after it begins the code will continue to execute. i think my code is running too fast to allow all the files to copy properly.(right now i dont even get the first file in the sequence to copy).
im wondering if there is a way to halt the execution of the script while i await a result of the of the filecopy() function.
DIM i AS INTEGER;
DIM ii AS MESSAGE;
DIM FirstSpace AS INTEGER;
DIM FileDate AS MESSAGE;
DIM monitor AS MESSAGE;
DIM result AS INTEGER;
IF DataLoggerDateNotValid==0 THEN
FOR i=0 TO DataLogSpan STEP 1
ii=StringFromIntg(i,10);
DataLoggerIndirectDate.Name="DataLoggerDate"+ii;
FirstSpace= StringInString( DataLoggerIndirectDate," ",1,0);
FileDate=StringReplace(StringTrim(StringLeft(DataLoggerIndirectDate,FirstSpace - 1),2),"/","_",0,-1,0);
FileWriteMessage ("C:\Users\Josh\Desktop\WonderWareDataLogger\DISPATCH_SCANNER_DETAILS\DISPATCH_"+FileDate+".csv", 0 , "",1); {Header Of FIle}
result=FileCopy("C:\WWtestFolder\DISPATCH_"+FileDate+".csv","C:\Users\Josh\Desktop\WonderWareDataLogger\DISPATCH_SCANNER_DETAILS\DISPATCH_"+FileDate+".csv" ,monitor); {Header Of FIle}
NEXT;
ENDIF;