ページ 11

構造体の継承

Posted: 2005年6月25日(土) 00:55
by 高信期

コード: 全て選択


Type Test1
  A As Long
End Type

Type Test2
  inherits Test1
Protected
  B As Long
End Type

Class Test3
  inherits Test2
Public
  Sub IncB()
    B = B + 1
  End Sub

  Function Sum() As Long
    Sum = A + B
  End Function
End Class

#prompt
Dim Test As Test3
Test.A = 10
Test.IncB()
Print Str$(Test.Sum())
と、上記のように構造体から新たな構造体やクラスへ継承できますが、
これはバグなのでしょうか?

AB Ver 4.01.02