Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What to log when alias is not open?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01642948
Message ID:
01642983
Views:
43
>>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
>
Thank you for the suggestion and for the code. But I am thinking.. I am trying to determine why a certain Cursor Adapter cursor is not open. How having names of all open work areas will help in this?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform