vb 中怎样将自定义用户类型作为函数的参数传递
答案:2 悬赏:0 手机版
解决时间 2021-03-31 04:31
- 提问者网友:遮云壑
- 2021-03-30 05:44
vb 中怎样将自定义用户类型作为函数的参数传递
最佳答案
- 五星知识达人网友:封刀令
- 2021-03-30 06:04
Private Function BiJiao(ByRef CP As MC, ByRef C_P As MC) As Integer ’intger写错了
p = 0
Sum = 0
For i = 1 To 6
For j = 1 To 6
If CP.Hong(i) = C_P.Hong(i) Then Sum = Sum + 1
Next j
Next i
If CP.Lan = C_P.Lan Then p = 7 ‘CP.Hong.Lan写错了
BiJiao = Sum + p ‘BiJiao()不能打括号
End Function
p = 0
Sum = 0
For i = 1 To 6
For j = 1 To 6
If CP.Hong(i) = C_P.Hong(i) Then Sum = Sum + 1
Next j
Next i
If CP.Lan = C_P.Lan Then p = 7 ‘CP.Hong.Lan写错了
BiJiao = Sum + p ‘BiJiao()不能打括号
End Function
全部回答
- 1楼网友:玩世
- 2021-03-30 06:14
Private Type MC '先定义类型
Id As String
Hong(1 To 6) As Integer
Lan As Integer
End Type
Dim CP As MC '后用定义的类型定义变量
Dim C_P As MC追问我在通用代码段 已经定义了呀
Id As String
Hong(1 To 6) As Integer
Lan As Integer
End Type
Dim CP As MC '后用定义的类型定义变量
Dim C_P As MC追问我在通用代码段 已经定义了呀
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯