Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Release a form
Message
 
À
12/11/2004 11:37:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Divers
Thread ID:
00960885
Message ID:
00962001
Vues:
13
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform