VB子程序或函数未定义要怎么办?
这是一个制作简单的计算机的编程
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0 To 9
If firstnum Then
strnurm1 = st(Index) '实型转字符型
Else '非初赋值
strnum1 = strnum1 + Str(Index)
End If
test1.Text = strnum1 '显示
End Select
Case 10
If Not pointflag Then '如果没有小数点
If firstnum Then '如果是第一个字符
strnum1 = "0."
firstnum = False
Else
strnum1 = strnum1 + "."
End If
Else '已有小数点
Exit Sub '则退出单击事件
End If
pointflag = ture
Text1.Text = strnum1
End Sub
最佳答案
二处有问题:
1、trnurm1 = st(Index) 应该是 trnurm1 = Str(Index)
2、End Select 的位置似乎不妥,应该放在最后吧
其他回答
暂无其它回答!