Re: [VB6 ] 想請問關於TYPE的問題,不能循環依存?

看板Visual_Basic作者 (人比人Cheese人)時間18年前 (2008/03/12 06:59), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《otima ()》之銘言: : Type typeWave : Data as Integer : Child() as typeWave : End Type 用物件類別模組可以達到你的需求 很久沒用VB6了, 剛剛拿回來用用看, 覺得很不習慣呀! 以下一個小範例, 如果需要多個child, 用VB的陣列或collection都可以實做... '---------表單程式碼---------' Private Sub Form_Paint() Set a = New Node Print a.createChild.createChild.createChild.createChild.Index End Sub '---------物件類別模組---------' Option Explicit Private id As Integer Public Function createChild() As Node Set createChild = New Node createChild.Index = id + 1 End Function Public Property Get Index() As Integer Index = id End Property Property Let Index(value As Integer) id = value End Property -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.133.134.222
文章代碼(AID): #17rmwuFc (Visual_Basic)
文章代碼(AID): #17rmwuFc (Visual_Basic)