请问这句VB代码为什么错误??
来源:百度知道 编辑:UC知道 时间:2024/09/21 15:47:11
Text1.Text = Replace(Text1.Text, Mid(Text1.Text, dierhuiche, 1), vbCrLf + i + ".")
其中,i=1,dierhuiche为一个特定回车的位置
错误提示的是:无效的过程调用或参数
我的dierhuiche是dierhuiche = InStrRev(Text1.Text, vbCrLf, diyihuiche)即instrrev返回的值
其中,i=1,dierhuiche为一个特定回车的位置
错误提示的是:无效的过程调用或参数
我的dierhuiche是dierhuiche = InStrRev(Text1.Text, vbCrLf, diyihuiche)即instrrev返回的值
vbCrLf + i + "."
换成
vbCrLf & i & "."
如果不行,你就监视每个参数,看是哪个出了问题。
dim x as string
dim dierhuiche as Integer
dierhuiche = InStrRev(Text1.Text, vbCrLf, diyihuiche)
’有可能你的dierhuiche 返回值有问题,比如为-1,则下句就错了:
x=Mid(Text1.Text, dierhuiche, 1)
是类型不匹配?
i换成"i"
将+换成&
这样就没错了~~可能是你没有事先设好参数的值
Private Sub Command1_Click()
Dim i, dierhuiche As Integer
i = 1
dierhuiche = 1
Text1.Text = Replace(Text1.Text, Mid(Text1.Text, dierhuiche, 1), vbCrLf & i & ".")
End Sub