Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Release a form
Message
 
To
12/11/2004 11:37:24
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00960885
Message ID:
00962001
Views:
14
>Hi All
>Releasing a form with a lots of object(i.e. 2000) takes a while (5-10 sec)
>It looks to me that I'm missing something here because in VB works at once.
>
>Thanks in advance

Yes, for 2000 objects it takes my test program 3.5 seconds
local loForm, lnStart

lnStart = Seconds()
loForm = Createobject('TestForm', 2000)
lnCreatedIn = Seconds() - lnStart
loForm.Show(1)
lnStart = Seconds()
loForm.release()
activate screen
clear
? 'Created in: ', lnCreatedIn
? 'Destroyed in: ', Seconds() - lnStart

define class TestForm as Form
	add object cmdExit as CommandButton with ;
		Caption = 'Exit', ;
		Left = 0, ;
		Top = 0
		
	procedure cmdExit.Click()
	thisform.Hide()
	endproc
	
	procedure init(tnObjects)
	local lnObjects, lnObject, lcName
	
	lnObjects = Iif(Vartype(tnObjects) = 'N', tnObjects, 10)
	for lnObject = 1 to lnObjects
		lcName = 'Object' + Transform(lnObject, '@L 999999999')
		this.AddObject(lcName, 'TextBox')
	next i
enddefine
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform