I've got this code (I was testing some inheritance-stuff):
The first line after the type-declarations (NewStation:Station = New Station) executed both "New()"-methods (both strings in the New-method are printed), but the second line (NewStation.Create())
only executed the Create()-method from the Station type.
Is this normal?
This inheritance-stuff is confusing me a bit.
And using this setup, how could I execute the Create-method from the Sector type (without renaming both methods)?
The easiest way would be to rename both Create()-methods to CreateSector and CreateStation, as I tried and it worked as expected.
Type Sector Method New() Print "Sector method was called" End method Method Create() Print "New sector has been created" End Method End type Type Station Extends Sector Method New() Print "Station method was called" End method Method Create() Print "New station has been created" End Method End type NewStation:Station = New Station NewStation.Create()
The first line after the type-declarations (NewStation:Station = New Station) executed both "New()"-methods (both strings in the New-method are printed), but the second line (NewStation.Create())
only executed the Create()-method from the Station type.
Is this normal?
This inheritance-stuff is confusing me a bit.
And using this setup, how could I execute the Create-method from the Sector type (without renaming both methods)?
The easiest way would be to rename both Create()-methods to CreateSector and CreateStation, as I tried and it worked as expected.