Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
STRTOFILE() is working strange...
Message
De
23/08/2002 04:53:56
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
STRTOFILE() is working strange...
Divers
Thread ID:
00692805
Message ID:
00692805
Vues:
52
I'm using STRTOFILE() in my error handler to write the error message out to a text file, it has always worked perfect but a couple of months ago (I havn't had the time to investigate it yet) it stopped working, STRTOFILE() is supposed to append the new error message to the end of the file, but if the file exist, it doesn't work, it doesn't write anything to the error log and doesn't give any error message either. This is my error log code:
FUNCTION errorlog
LPARAMETER lnError, lcMessage, lcCode, lcProgram, lnLineNo
LOCAL lcErrorMsg

** Store the error to a file.
lcErrorMsg	= ''
lcErrorMsg	= lcErrorMsg + 'DATE     : ' + TRANSFORM(DATETIME()) + CRLF
lcErrorMsg	= lcErrorMsg + 'ERROR    : ' + TRANSFORM(lnError) + CRLF
lcErrorMsg	= lcErrorMsg + 'MESSAGE  : ' + lcMessage + CRLF
lcErrorMsg	= lcErrorMsg + 'CODE     : ' + lcCode + CRLF
lcErrorMsg	= lcErrorMsg + 'PROGRAM  : ' + lcProgram + CRLF
lcErrorMsg	= lcErrorMsg + 'LINE NO  : ' + TRANSFORM(lnLineNo) + CRLF
lcErrorMsg	= lcErrorMsg + REPLICATE('*', 80) + CRLF

=STRTOFILE(lcErrorMsg, 'error.log', 1)

** Show the error to the user.
=MESSAGEBOX('DATE ' + TABKEY +': '+ TRANSFORM(DATETIME()) + CRLF + ;
	'ERROR ' + TABKEY +': '+ TRANSFORM(lnError) + CRLF + ;
	'MSG ' + TABKEY +': '+ lcMessage + CRLF + ;
	'CODE ' + TABKEY +': '+ lcCode + CRLF + ;
	'PRG ' + TABKEY +': '+ lcProgram + CRLF + ;
	'LINE ' + TABKEY +': '+ TRANSFORM(lnLineNo) ;
	, 16, 'Program execution error!')

ENDFUNC
So what I end up with in my error.log file is one error message, the first one that was created, nothing else will appear... Is there some other thing that controls STRTOFILE() that might prevent it from writing to an existing file? Need some help...

Thanks in advance!
---( Mårten Törnquist )---
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform