Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with TRY...CATCH?
Message
De
16/07/2009 01:00:04
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Divers
Thread ID:
01412651
Message ID:
01412669
Vues:
88
>>>>Yes, excellent memory! Now to troll the bugfix list for SP2 to see if it's been fixed ...
>>>>
>>>It was not - at least it's not mentioned in the list of fixes.
>>
>>For lurkers, the list is at http://www.microsoft.com/downloadS/details.aspx?FamilyID=a28ddec6-ba3c-49d0-8176-8c0b3fca06d1&displaylang=en
>>
>>While TEXTMERGE is not mentioned, TRY...CATCH is mentioned once near the beginning. I suspect the problem actually is with TRY...CATCH. Maybe that fix also fixed this issue... I'll put together some repro code so someone with SP2 can test it.
>
>I can test it tomorrow too - don't have VFP here installed.

Here's some repro code:
SET TEXTMERGE ON ;
	TO SomeLogFile.log ADDITIVE ;
	NOSHOW

TEXT
This is Line1
ENDTEXT

TRY
	* Something that creates an error:
	x = y

CATCH
	* We don't really need to do anything here

ENDTRY

* Try to add a second line to the log file:
TEXT
This is Line2
ENDTEXT

* Close log file:
SET TEXTMERGE OFF
SET TEXTMERGE TO

* Do we have the string "Line2" in the log file?
?"TEXTMERGE file improperly closed by TRY...CATCH bug: " ;
	+ IIF( "Line2" $ FILETOSTR( "SomeLogFile.log" ), "False", "True" )
?VERSION()
This bug does not occur with VFP8 SP1, so it was introduced sometime after that.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform