Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRY CATCH Logic
Message
From
18/04/2008 01:06:50
 
 
To
17/04/2008 23:10:56
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01311613
Message ID:
01311620
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform