A computer only does what you tell it to?
Posted: Wed Sep 29, 2021 9:37 pm
Somehow this is copying things that I don't ask it to. I'm wondering if I'm missing something or if it is just a glitch. Its happening on a windows 10 desktop but I cant reproduce the issue in the livecode development environment. 99% of the time it works normally but sometimes it copies the folder i'm copying files from with random folders and files within that. and those files and folders aren't even *.NC1 files. Any ideas?
Code: Select all
on getPartList
send dbOpen to stack "MFC Tracking System"
put "SELECT piece_mark from parts_cutlist WHERE lot = '" & tSL & "' AND job = '" & tSJ & "' AND station = 'Plate Processor'" into tSQL
put revDataFromQuery(comma, return, gConnectionID, tSQL) into tPartList
send dbClose to stack "MFC Tracking System"
put empty into tJobFolder
set the defaultfolder to "C:\NC Files\"
put the files into filestodelete
repeat for each line tLine in filestodelete
delete file tLine
end repeat
set the defaultfolder to "\\10.0.15.15\NC Files\"
put the folders into joblist
repeat for each line tLine in joblist
if tLine contains tSJ then
if tJobFolder is empty then
put tLine into tJobFolder
else
put cr & tLine after tJobFolder
end if
end if
end repeat
repeat for each line ttLine in tJobFolder
repeat for each line tLine in tPartList
answer tLine
revCopyFile "\\10.0.15.15\NC Files\" & ttLine & "\" & tLine & ".NC1","C:/NC Files/"
end repeat
end repeat
end getPartList