
Multiple classes with a class
Try making the passenger class a subclass of the Airplane class.
dim Airplane() as clsAirplane
Public Class clsAirplane
dim mvarPassenger() as clsPassenger
{Property for Passenger}
end class
Public Class clsPassenger
dim mvarName as string
{Properties for Name}
End Class
The trick to this, in the Airplane class, remember to set the datatypes for
the Passenger property AS clsPassenger. Also, remember that the property is
in array, so you must include an index and redim the sucker if needbe.
Setting the Passenger Property would be something like:
Airplane(1).Passenger(1).Name
It's soo much nicer than the old Type Array's, and is very easy to manage.
If ya want more info, send me an e-mail and I can help you out with more.
BTW, you can have a subClass of the SubClass, I've gone down to 45
subclasses under the Parent Class. I got this method from a game, of all
places!
HTH
Jody W
This will compartmentalize the subclass into the Parent class.
Quote:
> Hi Guys,
> I am trying to write a VB.NET app that is real world
> modelled by have one class (the aeroplane class) that
> contains several instances of another class (the
> passenger class). Please can someone explain
> to me how I should model with in VB.NET. I can't
> seem to find any good help on the subject or I am
> not looking in the correct place.
> Any help is much appreciated.
> Regards,
> Jason.