[DGD] Re: Inheritance question

harte at xs4all.nl harte at xs4all.nl
Fri Oct 10 05:50:46 CEST 1997


Quoting your message from  9 Oct:
| I'm feeling somewhat stupid about not being able to work this out on my
| own, but the hours spent fooling with it are starting to add up so....
| 
| if in object C I inherit A and B and all three have a create function then
| in C I would expect to be able to reference the create in A and B by.
| 
| create(int clone) {
| 	A::create(clone);
| 	B::create(clone);
| }
| 
| what I get is an undefined label error during the compile of C. Anybody
| want to be nice and tell me what I am overlooking. Its easy enough to get
| around by just making the create in A and B into init_A and init_B and
| calling them but I dont understand why the A::create syntax is incorrect.

DGD doesn't have implicit labels for the programs that you inherit, so
if you want to refer to an inherited program with a label, you'll have
to add one yourself like this:

  inherit A "/your/program/A";
  inherit B "/your/program/B";

After which your calls to A::create(clone) and B::create(clone) should
work just fine.

Hope that helps. :)

Erwin.
-- 
[  Erwin Harte  |  Email: harte at xs4all.nl  ]




List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list