vb 编译错误else 没有if

2025-03-20 01:41:13
推荐回答(1个)
回答1:

else前面少了循环结束next i
Dim cd As Integer
If IsNumeric(Text1.Text) Then
cd = Len(Text1.Text)
For i = 1 To cd
j = Mid(Text1.Text, i, 1)
Select Case j
Case "1": Text1.Text = Text1.Text + 壹
Case "2": Text1.Text = Text1.Text + 贰
Case "3": Text1.Text = Text1.Text + 叁
Case "4": Text1.Text = Text1.Text + 肆
Case "5": Text1.Text = Text1.Text + 伍
Case "6": Text1.Text = Text1.Text + 陆
Case "7": Text1.Text = Text1.Text + 柒
Case "8": Text1.Text = Text1.Text + 扒
Case "9": Text1.Text = Text1.Text + 玖
Case "0": Text1.Text = Text1.Text + 零
End Select
Next i
Else
MsgBox "请输入数字!", "0", "错误"
Text1.SetFocus
End If