Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cyclic class definition?
Message
De
24/08/1998 09:27:46
 
 
À
24/08/1998 08:25:16
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00129227
Message ID:
00129299
Vues:
24
>Remus,
>You mean you add a class to itself ? In class designer it would cause a cyclic definition (two mirrors looking each other). C1 container would include another C1 which in turn should include C1 including C1 and in turn it should include C1.... and so on, a cyclical definition. But at form level you could do it.
oForm = createobject("Form")
>with oForm
>	.height=400
>	.width=600
>	.addobject("m1","mycontainer",300,500)
>	.m1.addobject("m1","mycontainer",200,400)
>	.m1.m1.addobject("m1","mycontainer",100,300)
>	.m1.m1.m1.addobject("m1","mycontainer",50,200)
>	.m1.visible = .t.
>	.m1.m1.visible = .t.
>	.m1.m1.m1.visible = .t.
>	.show
>endwith
>read events
>
>define class mycontainer as container
>	procedure init
>	lparameters pnHeight,pnWidth
>	this.height = pnHeight
>	this.width = pnWidth
>	endproc
>enddefine
Cetin
Cetin,
Your code is exact my situation. My poblem is that i MUST store the class definition in a VCX. Same form object and MyContainer class stored in a VCX cause the error!
I don't try to define a class based on its own.
I have a container class (like your 'MyContainer'), and in a form derived object (stored in a VCX), I need to create a set of 'MyContainer' instances, but nested inside one another. Exact like your example! I don't have a cyclical definition! The involved container class is defined in a different VCX.
If I try your example in a SCX form, it works. But not in a VCX!
Anyway, you give my an ideea and I think it will work. I'll explain to you later.
Remus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform