Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cyclic class definition?
Message
De
24/08/1998 08:25:16
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/08/1998 07:07:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00129227
Message ID:
00129265
Vues:
32
>>If you rename the class (not the object) then problem would be solved but remember renaming would effect all forms that used it.
>>Cetin
>Cetin,
>I'm not sure I follow you. Do you mean to add a different class as the contained object?
>I cannot add a different class into my container. I must add same class as the container. Even more, the nesting level is undetermined...
>I noticed that if i use base classes, the error doesn't appear. But I cannot make any use of the base class containers..
>Remus
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform