Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set safety on
Message
De
14/01/2006 11:59:34
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01086803
Message ID:
01086823
Vues:
62
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform