Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
On Error...Ok in VFP6 not in VFP7
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00551946
Message ID:
00552431
Views:
18
>It works modular but if error is inside the form, it does not. I don't know why?
>
>The errtrap program is successfully invoked but parameters are always .F.
< SNIP >

Hi Jess,

Works for me. Below's my test code. Can you post your code that reproduces the problem?
ON ERROR DO ERRTRAP WITH ERROR(), PROGRAM(), LINENO()

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show

RETURN

PROCEDURE ERRTRAP (nErrorNo, cProgram, nLineNo)

cMsg = "Error number : "+ALLTRIM(STR(nErrorNo))+CHR(13)+;
       "Origin       : "+cProgram+CHR(13)+;
       "Description  : "+MESSAGE()+CHR(13)+;
       "Line number  : "+ALLTRIM(STR(nLineNo))

Wait WINDOW cMsg

RETURN

DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 204, ;
		Left = 54, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command1", ;
		Name = "Command1"

	PROCEDURE command1.Click

		a = b
	ENDPROC

ENDDEFINE
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform