Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Logging custom class operations
Message
From
14/05/2009 13:33:01
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Logging custom class operations
Miscellaneous
Thread ID:
01399909
Message ID:
01399909
Views:
105
My class begins like this:
define class FoxReportServer as session olepublic
*************************************************************
	cAppStartPath = ""
	cBasePath = ""
	lError = .f.
	cErrorMessage = ""
	cOutputFile = ""
	cSQL = ""
	cReportName = ""
	cLogFile = ""
	cDataFolder = ""
	cReportFolder = ""

************************************************************************
* FoxReportServer :: Init
************************************************************************
	function init
		set resource off
		set exclusive off
		set cpdialog off
		set deleted on
		set exact off
		set safety off
		set reprocess to 2 seconds
		if inlist(_vfp.startmode,2,3,5)
			set default to (justpath(_vfp.servername))
		endif
		crlf = chr(13)+chr(10)
		this.cLogFile = "foxReportServer.log"
		erase (this.cLogfile)
		dodefault()

** Utility routines
		strtofile("Start at: " + ttoc(datetime()) + crlf,this.cLogFile,1)
		this.cAppStartPath = addbs(justpath(application.servername))	&& c:\inetpub\wwwroot\foxreportserver\
		this.cBasePath = addbs(justpath(justpath(this.cAppStartPath)))	&& c:\inetpub\wwwroot\
		set path to (this.cAppStartPath)

*		set path to "g:\inetpag\webdatabases\mainstreetinfodata\" additive
		strtofile("INIT complete at: " + ttoc(datetime()) + crlf,this.cLogFile,1)
	endfunc
*********************************************************************************
function SetPath(tcDataFolder, tcReportFolder)
	strtofile("Start SetPath at: " + ttoc(datetime()) + crlf,this.cLogFile,1)
	this.cDataFolder = this.cBasePath + tcDataFolder
	this.cReportFolder = this.cBasePath + tcReportFolder
	set path to (this.cDataFolder) additive
	set path to (this.cReportFolder) additive
	strtofile("Path set to " + set("path") + crlf, this.cLogFile,1)
endfunc
*********************************************************************************
The logging to cLogfile works fine within the INIT but does not seem to execute in the SetPath() function even though the function seems to complete OK. Can someone tell me why and how to fix? The other properties IE cBasePath seem to be visible OK.
Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform