CODE
Dim first As Double
Dim second As Double
Dim third As Double
Dim sign As String
Dim calculated As Boolean
Private Sub Command1_Click(Index As Integer)
If Text1.Text = " " Then
Text1.Text = Command1(Index).Caption
ElseIf Text1.Text = "0" Then
Text1.Text = Command1(Index).Caption
Else
Text1.Text = Text1.Text & Command1(Index).Caption
End If
End Sub
Private Sub Command2_Click()
If InStr(Text1.Text, ".") = 0 Then
Text1.Text = Text1.Text & "."
End If
End Sub
Private Sub Command3_Click()
second = Text1.Text
If sign = "+" Then
Text1.Text = (first + second)
ElseIf sign = "-" Then
Text1.Text = (first - second)
ElseIf sign = "*" Then
Text1.Text = (first * second)
ElseIf sign = "/" Then
Text1.Text = (first / second)
End If
End Sub
Private Sub Command4_Click(Index As Integer)
first = Text1.Text
Text1.Text = " "
sign = Command4(Index).Caption
End Sub
Private Sub Command5_Click()
Text1.Text = "0"
End Sub
Private Sub Command6_Click()
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
If Text1.Text = "" Then
Text1.Text = "0"
End If
End Sub
Private Sub Form_Load()
Text1.MaxLength = 12
End Sub
<this is my codes making an calculator in array.. but theres some problems here.. hmm it cannot compute continiously, example: 1+1+1+1=4 like that hope so some1 can help me.. plz...>