代码有没有错?哪里错了!在线等待!!!!!!!!!!!!!!

[复制链接]
查看11 | 回复1 | 2011-2-17 01:40:05 | 显示全部楼层 |阅读模式
Dim a As Double
Dim b As Double
Dim flg As Boolean
Dim str As String

Private Sub Command1_Click(Index As Integer)
If (Len(Text1.Text) = 1 And Val(Text1.Text) = 0) Or flg = False Then

Text1.Text = \\\"\\\"
End If
flg = True
Text1.Text = Text1.Text1 Then

Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
ElseIf Len(Text1.Text) = 1 Then

Text1.Text = 0
End If

End Sub

Private Sub Form_Load()
Text1.MaxLength = 12
Text1.Locked = True
flg = True
a = 0
End Sub


Private Function Calculation(a As Double, b As Double, str As String)
Select Case str

Case \\\" \\\"

a = a b

Case \\\"-\\\"

a = a - b

Case \\\"*\\\"

a = a * b

Case \\\"/\\\"

a = a / b
End Select
Calculation = a
End Function
回复

使用道具 举报

千问 | 2011-2-17 01:40:05 | 显示全部楼层
<pre id=\\\"best-answer-content\\\">你这是要编一个计算器吧。你这个程序语法是没有错误的,但逻辑有点问题,这样导致计算的时候会出现混乱。明天我要有时间就帮你改改。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行