*> Interface definition
interface-id IClock
01 Hour binary-long property with no set.
01 Minute binary-long property with no set.
method-id Reset.
end method.
end interface.
*> Extending an interface
interface-id IAlarmClock implements type IClock.
01 AlarmHour binary-long property.
01 AlarmMinute binary-long property.
method-id Snooze (#time as binary-long).
end method.
end interface.
*> Interface implementation
class-id WristWatch implements type IAlarmClock,
type System.IDisposable.
working-storage section.
01 Hour binary-long property with no set.
01 Minute binary-long property with no set.
01 AlarmHour binary-long property.
01 AlarmMinute binary-long property.
method-id Dispose.
invoke self::Reset()
end method.
method-id Reset.
set Hour to 0
set Minute to 0
set AlarmHour to 0
set AlarmMinute to 0
end method.
method-id Snooze (#time as binary-long).
add #time to AlarmMinute
end method.
end class.
インターフェイスのサンプルも参照してください。このサンプルは、Start > All Programs > Micro Focus Visual COBOL > Samples、COBOL for .NET の場合。 に用意されています。