>I am exporting data to a csv file using STRTOFILE. I set safety on before i issue the command and it prompts me to overwrite if the file already exists.
>
>How do i trap the reply (ie. 'yes' to overwrite, or 'no' not to)?
>
>SET SAFETY ON
>STRTOFILE("Detail Report" + CHR(13), ALLTRIM(txtSaveAs), .F.)
Instead of Safety On, you can use the PutFile() function to get the filename (if the file isn't already defined, that is). It will ask for confirmation and return an empty string if the user chose NO.
If you don't let the user choose the filename, then go with Borislav's solution.