我先在模块中定义了个函数
Public Function method00(max_up As Integer, carname2, carname3 As String)
..............
end function
在一个窗口中引用这个参数
Dim max2 As Integer
Dim sma, mid, lar As String
Call calucatemethod00(max2, mid, lar)
Text1.text = max2
Text2.text = mid
Text3.text = lar
这样运行后正常。
但很奇怪的是我把lar换成sma时
即:Call calucatemethod00(max2, mid, sma)
Text1.text = max2
Text2.text = mid
Text3.text = sma
就报错显示:ByRef参数类型不符。
百思不得其解,这三个参数不是一摸一样的吗? 以前好像也碰到过这样的问题,当时没在意,改了改就过去了,不过再次碰到时就觉得肯定是我们哪里有问题了,请高手指正。
Public Function method00(max_up As Integer, carname2, carname3 As String)
..............
end function
在一个窗口中引用这个参数
Dim max2 As Integer
Dim sma, mid, lar As String
Call calucatemethod00(max2, mid, lar)
Text1.text = max2
Text2.text = mid
Text3.text = lar
这样运行后正常。
但很奇怪的是我把lar换成sma时
即:Call calucatemethod00(max2, mid, sma)
Text1.text = max2
Text2.text = mid
Text3.text = sma
就报错显示:ByRef参数类型不符。
百思不得其解,这三个参数不是一摸一样的吗? 以前好像也碰到过这样的问题,当时没在意,改了改就过去了,不过再次碰到时就觉得肯定是我们哪里有问题了,请高手指正。
解决方案 »
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);这句是什么意思,有什么作用
- 什么情况下用listview,什么情况下用msflexgrid呀?
- 如何在filelistbox中只显示.bmp文件
- 80分献给你!
- 各位大哥大姐,帮帮忙,100分奉送
- 有些软件用VB编的,但那菜单是XP的是怎么做的啊!有没有生成这种菜单的。免费控件下载了!
- 高分寻找手机发送短信的相关代码???????
- 请问用DAO如何来让picturebox控件来显示图片
- 用键盘控制鼠标的移动
- 急急急!!关于Microsoft(r) Data Access Components 2.0的问题!!!
- TreeView与Nodes交换数据的问题
- 请问用户拖动listview列表头来调整宽度时,触发什么事件
Dim strsql As String
Dim CR As New ADODB.Recordset
Dim CR1 As New ADODB.Recordset
Dim CR2 As New ADODB.Recordset
Dim CR3 As New ADODB.Recordset
Dim a, b, c, sum, n, i As Integer
Dim name_1, name_2, name_3 As String
Dim x(1000) As Integer
i = 1
CR.CursorLocation = adUseClient
CR.CursorType = adOpenKeyset
CR.LockType = adLockOptimistic
CR1.CursorLocation = adUseClient
CR1.CursorType = adOpenKeyset
CR1.LockType = adLockOptimistic
CR2.CursorLocation = adUseClient
CR2.CursorType = adOpenKeyset
CR2.LockType = adLockOptimistic
CR3.CursorLocation = adUseClient
CR3.CursorType = adOpenKeyset
CR3.LockType = adLockOptimistic
name_1 = frmRecaculate.Combo2.text
name_2 = frmRecaculate.Combo1.text
CR.Open "select * from csh轿运车 where 车牌号 ='" & name_2 & "'", cn
CR1.Open "select * from " & name_1 & " where 型号1 ='大'", cn
CR2.Open "select * from " & name_1 & " where 型号1 ='中'", cn
CR3.Open "select * from " & name_1 & " where 型号1 ='小'", cn
n = CR1.RecordCount + CR2.RecordCount + CR3.RecordCount
For b = 1 To CR2.RecordCount
If b > 1 Then
CR2.MoveNext
End If
For c = 1 To CR3.RecordCount
If c > 1 Then
CR3.MoveNext
End If
sum = (CR2!长) + 5 * (CR3!长)
Dim carname_2(1000), carname_3(1000) As String
If sum < (CR!l + CR!L1 + CR!L5 + 10000) Then
x(i) = sum
carname_2(i) = CR2!型号
carname_3(i) = CR3!型号
i = i + 1
End If
Next c
CR3.MoveFirst
Next b
CR2.MoveFirst Dim j As Integer '求最大值
max_up = x(1)
carname2 = carname_2(1)
carname3 = carname_3(1)
For j = 1 To UBound(x)
If x(j) > max_up Then
max_up = x(j)
carname2 = carname_2(j)
carname3 = carname_3(j)
End If
Next j
End Function
即:dim sma as string
dim mid as string
dim lar as string
就不知道弄成dim sma,mid,lar as string 为什么会报错
dim sma,mid,lar as string
=
dim sma as Variant
dim mid as Variant
dim lar as string
VB6 不是 C++ .............