我要编一个把数字翻译成汉字的程序,要求用CHOOSE函数,过程:

总是说我“B = Choose(A, "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")”有错,不太知道错在哪,望高手指点!!!
Private Sub Text1_Change()
Dim A%, B%
A = Val(Text1.Text)
Select Case A
Case 0 To 9
B = Choose(A, "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")
Picture1.Print A & "→" & B
Case Else
Picture1.Print "输入的不是数字字符"
End Select
End Sub

犯罪嫌疑人X
浏览 68回答 1
1回答

隔江千里

Option ExplicitPrivate Sub Text1_Change()Dim A As Integer, B As StringA = Val(Text1.Text)Select Case ACase 0 To 9B = Choose(A + 1, "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")Print A & "→" & BCase ElsePrint "输入的不是数字字符"End SelectEnd Sub你主要定义函数时错误及Choose使用错误.另外,不必要使用Picture控件.Choose(index, choice-1[, choice-2, ... [, choice-n]])index 必要参数,数值表达式或字段,它的运算结果是一个数值,且界于 1 和可选择的项目数之间。 choice 必要参数,Variant 表达式,包含可选择项目的其中之一。
打开App,查看更多内容
随时随地看视频慕课网APP