首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VBA >

VBA怎么向函数传递结构体参数

2012-02-03 
VBA如何向函数传递结构体参数Private Type BOMstructBOMname As Stringqty As IntegerEnd TypeDim objBOM

VBA如何向函数传递结构体参数
Private Type BOMstruct
  BOMname As String
  qty As Integer
End Type

Dim objBOM As BOMstruct
Dim iStack() As BOMstruct
Dim TailPointer As Double

Private Sub Push(BOM As BOMstruct)
ReDim Preserve iStack(TailPointer)
iStack(TailPointer) = BOM
TailPointer = TailPointer + 1
End Sub

Sub TEST()
  Push(objBOM) 'compile error- variable can't assign to this expression
End Sub

[解决办法]
Push(objBOM)
也许改为
 Push objBOM

热点排行