Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
>How can I get the information what the user chose (Yes or No) when the message “The file 'filename' already exist, overwrite it?” pops up?
You should test for the file existence first, then overwrite. The SAFETY function should be ON by default. FoxPro can be used to data processing work from the command line. In such instances, overwriting the file by default could be dangerous.
IF FILE('SomeFile')
IF MESSAGEBOX("File exists. Overwrite?",36) = 6
LOCAL m.lcOldSafety
m.lcOldSafety = SET("SAFETY")
SET SAFETY OFF
*Overwrite the file.
SET SAFETY &lcOldSafety.
ENDIF
ENDIF
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only