Sorry to hijack this thread but Im wondering using the above code - how do you reference the Extended type (tstudent) to be used with an function outside the type.
NO sooner I post then I find the answer
Type TStudent Field age% Method GetAge%() Return age End Method End Type Type TStudentMusician Extends TStudent End Type Type ITStudent Extends TStudent End Type ' 'How can you reference the age field using a function ? ' Local student1:TStudentMusician = New TStudentMusician Local student2:ITStudent = New ITStudent student1.age = 23 student1.age = 28 DebugLog( ShowAge(student1)) DebugLog( ShowAge(student2)) Function ShowAge:Int( studentdata:Object ) ' <<< how to pass Return Studentdata.age End Function
NO sooner I post then I find the answer
Return Tstudent(Studentdata).age