Just a few uncertainties about types:
1) What happens if you create new instances of a type but don't add them to a list? Will they be inaccessible?
2) When attempting to access the field value of a derived type why is the base type field value returned? (Accessing the derived type's methods and functions work as expected). For example:
3) What are the benefits of declaring a new instance of a type using both the base and derived type names? Example:
Any enlightenment would be appreciated,
1) What happens if you create new instances of a type but don't add them to a list? Will they be inaccessible?
2) When attempting to access the field value of a derived type why is the base type field value returned? (Accessing the derived type's methods and functions work as expected). For example:
SuperStrict Type animal Field name:String = "Animal" Method eat() Print name + " eating food" End Method End Type Type cat Extends animal Field name:String = "Cat" Method eat() Print name + " eating fish" End Method End Type Print Local pet1:animal = New animal Print pet1.name pet1.eat Print Local pet2:animal = New cat Print pet2.name 'Why is this not printed as "Cat" ? pet2.eat Print Local pet3:cat = New cat Print pet3.name pet3.eat
3) What are the benefits of declaring a new instance of a type using both the base and derived type names? Example:
pet1:animal = New cat as opposed to just declaring: pet1:cat = New cat
Any enlightenment would be appreciated,