Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it a bug for code-execution order?
Message
From
06/11/2007 19:57:21
Lu Ping
Zhuhai Tec Co.
Zhuhai, China
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Is it a bug for code-execution order?
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01267162
Message ID:
01267162
Views:
54
Different code-execution order by whether t1 window is current active window.
The test code below.
Thanks for anyone's test.
SET PROCEDURE TO xd
ON KEY LABEL CTRL+A do closeme

PUBLIC o1 ,o3
o1 = CREATEOBJECT([t1])
o3 = CREATEOBJECT([t2])
IF MESSAGEBOX([show t1 form as top window?] ,4 ,[]) = 6		
	*- press ctrl+a ,then execute MESSAGEBOX([closeme]) first ,then execute MESSAGEBOX([destroy])
	o3.show
	o1.show
ELSE 
	*- press ctrl+a ,then execute MESSAGEBOX([destroy]) first ,then execute MESSAGEBOX([closeme]) 
	o1.show
	o3.show
ENDIF 
DEFINE CLASS t1 as Form 
	PROCEDURE destroy
		MESSAGEBOX([destroy])
	ENDPROC 
ENDDEFINE 

DEFINE CLASS t2 as Form 
	ADD OBJECT c1 as commandbutton
	PROCEDURE c1.click
		=cl()
	ENDPROC 
ENDDEFINE 


PROCEDURE closeme
	RELEASE o1
	RELEASE o3
	MESSAGEBOX([closeme])
	ON key 
ENDPROC 

PROCEDURE cl
	=closeme()
ENDPROC 
Next
Reply
Map
View

Click here to load this message in the networking platform