Im having an issue with being unable to move a file. Perhaps a fresh set of eyes may be able to point out if i am missing something:
I get the dialog that the the file was backed up, but the file remains in the source folder and there is nothing in the OldClaims folder.
Code:
-- Determine if there is a claims.mpn file to be backed up found = File.DoesExist(_SourceFolder .. "\\claims.mpn"); -- If file found, backup to OldClaims folder otherwise alert user no file to backup if found == true then -- Determine if there is an OldClaims folder, if not, create it claimsfolder = Folder.DoesExist(_SourceFolder .. "\\OldClaims"); if claimsfolder ~= true then Folder.Create(_SourceFolder .. "\\OldClaims"); end -- Set variables for current date and time cdate = System.GetDate(DATE_FMT_US); ctime = System.GetTime(TIME_FMT_AMPM); File.Move(_SourceFolder .. "\\claims.mpn", _SourceFolder .. "\\OldClaims\\claims_" ..cdate.. "_" ..ctime.. ".txt", false, true, false, false, nil); Dialog.Message("Finished", "Your claims file has been backed up.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); else Dialog.Message("Error", "No claims file to backup", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end
Comment