Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for Exclusive Open?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00741115
Message ID:
00752026
Views:
51
>Or, also as Garret suggested, for VFP8, something along these lines:
>
>TRY
>   USE HOME(2) + "data\customer" IN 0 EXCLUSIVE
>CATCH TO OERR
>   MESSAGEBOX(TRANSFORM(OERR.MESSAGE) + CHR(13) + ;
>      "LINE #:" + TRANSFORM(OERR.LINENO) + CHR(13) + ;
>      "LINE:" + TRANSFORM(OERR.LINECONTENTS), ;
>      16, "ERROR IN " + TRANSFORM(OERR.PROCEDURE))
>FINALLY
>ENDTRY
>
My code looks like yours (I think), I am setting up a textlog on Database Open. I get an error "TRY/CATCH/FINALLY/ENDTRY mismatch or error". What did I miss?
	PROCEDURE dbc_OpenData(cDatabaseName, lExclusive, lNoupdate, lValidate)
	*Immediately after DBC is opened.
		Public xxxDbc as Exception
		Try
			pubLogName = Alltrim(pubLogName)
		Catch  to xxxDbc
			If ( xxxDbc.ErrorNo == 12 )	&& pubLogName not set
			? xxxDbc.Message
			? xxxDbc.LineNo
			? xxxDbc.ErrorNo
			Public pubLogName = LOGNAMEPREFIX +"001.txt"
		Finally
		EndTry
	ENDPROC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform