Type TDOB 'date of birth Field day:Int, month:Int, year:Int Method toAge:TAge() Local age:TAge = New TAge 'code here to convert dob into an age in years Return age End Method End Type Type TAge 'age in years Field years:Float 'the years will need to be stored as decimal to get an accurate dob Method toDOB:TDOB() Local dob:TDOB = New TDOB 'code here to convert years into dob Return dob End Method End Type Local age:TAge = New TAge age.years = 20 Local dob:TDOB = age.toDOB()
Not tested but should show the point, even if it's a trivial example. (Notice a New is not required for the last line).