Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TRY CATCH Logic
Message
De
18/04/2008 01:06:50
 
 
À
17/04/2008 23:10:56
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01311613
Message ID:
01311620
Vues:
17
>I've read the help, but I must not be understanding it. The directory inside the TRY does not exist, so I thought that it would then go to the CATCH and run that code. It doesn't. It just goes to the ENDTRY.
>
>
>TRY
>	MessageFullFileName = ALLTRIM(THIS.HL7OutDirectory) + SUBSTR(SYS(2015),4,8) + ".HL7"
>	STRTOFILE(THIS.oSendData.strProcessData,MessageFullFileName,0)
>CATCH TO oException
>	MessageFullFileName = ALLTRIM(THIS.HL7BackupDirectory) + SUBSTR(SYS(2015),4,8) + ".HL7"
>	STRTOFILE(THIS.oSendData.strProcessData,MessageFullFileName,0)
>ENDTRY
>
What you've actually found is some interesting behaviour on the part of STRTOFILE(). If the target folder doesn't exist, the command does not error, it appears to simply do nothing.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform