*TMT 01/22/2008 *-- SetErrorMode determines whether the system handles *-- serious errors or whether the program handles them. #define SEM_FAILCRITICALERRORS 0x0001 DECLARE INTEGER SetErrorMode in win32api INTEGER *TMT ************************************************** * If drive A is selected, copy to a and delete from c IF lcDrive == "A" lcSource = "c:\" + ALLTRIM(ThisForm.txtReportName.value) lcDest = "a:\" + ALLTRIM(ThisForm.txtReportName.value) ThisForm.txtStatus.value = "Copying to drive A:..." *-- SetErrorMode returns what the flags were last set. lnOldMode = SetErrorMode(SEM_FAILCRITICALERRORS) *-- Test the FoxPro DISKSPACE() function. If you get a -1, then *-- there is no disk in the drive. IF DISKSPACE("a:",1) = -1 MESSAGEBOX("No floppy disk present or insufficient space to save.",0,"Floppy Disk Error") ELSE COPY FILE (lcSource) TO (lcDest) ENDIF *-- Restore system error handling settings. = SetErrorMode(lnOldMode) *TMT DELETE FILE (lcSource) ENDIFBut.......... this assumes the API will not be changed by Microsoft in the future.....