Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Limit on Custom Class
Message
De
07/09/2005 09:56:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
07/09/2005 09:48:23
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01047325
Message ID:
01047331
Vues:
6
>Is there a limit on how many methods and or properties a custom class can have?

I know of no such limit - the limit is probably more of a practical nature: due to the way VFP manages variables, it will probably get slower if you have LOTS of properties.

Also, a class with thousands of properties MIGHT be an indication of a bad design.

Of course, you could just test it. The following code, which I put into a CommandButton, went all the way to 20,000 - I was too impatient to wait any longer. But after a few thousand properties, execution slowdown was quite noticeable.
i = 1
do while .T.
	if i % 100 = 0
		wait window nowait trans(i)
	endif
	PropertyName = "Prop" + trans(i)
	This.AddProperty(PropertyName)
	i = i + 1
enddo
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform