當前位置:成語大全網 - 新華字典 - VBA中有對象或結構體嗎?如何定義?

VBA中有對象或結構體嗎?如何定義?

對象?控件都是對象拉

dim a as object

dim b as new form1

b.show

......

結構這樣定義

type mySt

a as byte

b as integer

c as long

end type

dim m as mySt

不過要註意,為了實現內存對齊,vb會對結構體在內存中的結構進行調整.譬如上面的mySt在內存中大概是這樣的:

00 00 00 00 00 00 00 00 00 00 00 00

a_ 00 00 00 b_ __ 00 00 c_ __ __ __