I have a process that imports items from files exported from an existing system but it does not seem to work quite the way I expect it to... I 'd expect it to import both files, delete the file and the record from the list of files zz_import_files.
FIND zz_import_files WHERE zz_import_files.filename STARTSWITH 'BARCODES_'
If FILE_EXISTS(SystemSettings.Import_Location+zz_import_files.filename)='Yes' Then
IMPORT barcodes FROM ThisSystemSettings.Import_Location+Thiszz_import_files.filename IN BATCHES OF 10000 CREATE IF NOT FOUND
DELETE FILE ThisSystemSettings.Import_Location+Thiszz_import_files.filename
DELETE Thiszz_import_files
Which produces the following execution log

NB: I have tried with and without the "This" prefix
I have also tried many other variations but with similar and varying results.
I can work around this but would like to know why the above is doing what it is doing especially as the execution log states that it is adding two sets of actions, one for each of the zz_import_files found.
Thanks,
Tim