好心的人,快來救我吧,我寫了半天就是不成功,誰來替我修正一下
。如果可以傳一個正確的檔案給我好嗎?thank's
以下是我的程式部份:
Dim value1, value2 As Double
Dim c$, op$
'
'10個數字的程式內容,index從0到9
'
Private Sub Command1_Click(Index As Integer)
w$ = Right$(Str$(Index), 1)
If c$ <> "0" Then
c$ = c$ + w$
Else
c$ = w$
End If
Label1.Caption = c$
End Sub
Private Sub Command2_Click(Index As Integer)
value1 = Val(Label1.coption)
Select Case Index
Case 0
op$ = "+"
Case 1
op$ = "-"
Case 2
op$ = "*"
Case 3 = "/"
End Select
c$ = "0"
End Sub
Private Sub Command3_Click()
c$ = c$ + "."
Label1.Caption = c$
End Sub
Private Sub Command4_Click()
Call do_calc
c$ = "0"
op = ""
End Sub
Private Sub do_calc()
value2 = Val(Label1.Caption)
Select Case op$
Case "+"
value1 = value1 + value2
Case "-"
value1 = value1 - value2
Case "*"
value1 = value1 * value2
Case "/"
value1 = value2
End Select
v$ = Str$(value1)
Label1.Caption = v$
End Sub
Private Sub Command6_Click()
b$ = Label1.Caption
n = Len(b$)
c$ = Left(b$, n - 1)
Label1.Caption = c$
End Sub
Private Sub form_load()
value1 = 0
c$ = "0"
Label1.Caption = c$
op$ = ""
End Sub