Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What to log when alias is not open?
Message
 
 
To
09/11/2016 10:28:46
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01642948
Message ID:
01642981
Views:
62
>Hi,
>
>I review customers' error log files and very often see the error of a certain view (CursorAdapter cursor) not open where it is supposed to be open. Obviously something happens before the error, perhaps another error, that leads to the missing cursor. But customers don't report the errors and so I have to figure out on my own what happens. So I am planning to create a "hidden" log of information. Some information will be written in this log file every time the CA cursor is not open (where it is supposed to be open).
>
>My question is, what kind of information can I write in the log to help me get to the why the problem occurs?

Work areas used at the time of error
PROCEDURE WA_info
	LOCAL lcStr, lnOldArea, i, lnWa

	PRIVATE i, lcStr, lnOldArea, laWaList[1]
	lcCrLf = CHR(13) + CHR(10)
	lcStr = lcCrLf + lcCrLf
	*lcStr = DTOC(DATE()) + "   " + TIME() + lcCrLf + lcCrLf

	lnOldArea = SELECT()

	= AUSED(laWaList)


	FOR i = 1 TO ALEN(laWaList,1)
		lnWa = laWaList[i,2]
		SELECT (lnWa)
		IF i = lnOldArea
			lcStr = lcStr + "Current Work Area # " + ALLTRIM(STR(lnWa)) +lcCrLf
		ENDIF

		lcStr = lcStr + "Work Area # " + ALLTRIM(STR(lnWa))
		lcStr = lcStr + "   Alias " + PADR(ALIAS(), 11)
		lcStr = lcStr + "   Database " + ALLTRIM(DBF()) + lcCrLf + "    "
		lcStr = lcStr + "RecCount " + ALLTRIM(STR(RECCOUNT())) + "   "
		lcStr = lcStr + "RecNo " + ALLTRIM(STR(RECNO())) + "   "
		*	lcStr = lcStr + "Lock Status " + "'"+ SYS(2011) +"'" + "   "
		lcStr = lcStr + IIF(BOF(), "'BOF'   ", "")
		lcStr = lcStr + IIF(EOF(), "'EOF'   ", "")
		lcStr = lcStr + IIF(ISREADONLY(), "'ReadOnly'   ", "")

		IF RIGHT(lcStr, 2) = "   "
			lcStr = LEFT(lcStr, LEN(lcStr)-3)
		ENDIF

		lcStr = lcStr + lcCrLf + lcCrLf
	ENDFOR

	IF RIGHT(lcStr, 2) = "   "
		lcStr = LEFT(lcStr, LEN(lcStr)-3)
	ENDIF

	SELECT (lnOldArea)

	RETURN lcStr
	ENDPROC
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform