RosettaCodeData/Task/Delegates/OxygenBasic/delegates.oxy
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

44 lines
615 B
Text

class DelegateA 'not implmenting thing()
'==============
'
string message
end class
class DelegateB 'implementing thing()
'==============
'
string message
method thing() as string
return message
end method
'
end class
Class Delegator
'==============
'
has DelegateA dgA
has DelegateB dgB
'
method operation() as DelegateB
dgB.message="Delegate Implementation"
return @dgB
end method
method thing() as string
return "not using Delegate"
end method
'
end class
'====
'TEST
'====
Delegator dgr
let dg=dgr.operation
print dgr.thing 'result "not using Delegate"
print dg.thing 'result "Delegate Implementation"