yea I kinda figured out how to work the decimal problem out and i straightened and neatened my code a bit....
but another problem arose...
i can't seem to subtract or divide continously....
it still displays up to 15 numbers
CODE
Dim num1 As Double
Dim num2 As Double
Dim result As Double
Dim opt As Integer
Dim dic As Boolean
Private Sub cmdNUM_Click(Index As Integer)
If dic = True Then
txtnum = ""
If txtnum = "" Then
dic = False
End If
End If
txtnum = txtnum & cmdnum(Index).Index
End Sub
Private Sub cmdEQUALS_Click()
dic = True
num2 = Val(txtnum)
Select Case opt
Case Is = 0
result = num1 + num2
Case Is = 1
result = num1 - num2
Case Is = 2
result = num1 * num2
Case Is = 3
If num2 = 0 Then
MsgBox "Answer is Undefined", 0, "Error"
Else
result = num1 / num2
End If
End Select
txtnum = result
End Sub
Private Sub cmdDECI_Click()
txtnum = txtnum + "."
End Sub
Private Sub cmdOPRTR_Click(Index As Integer)
opt = cmdoprtr(Index).Index
num1 = Val(txtnum)
txtnum = ""
End Sub
Private Sub cmdSIGN_Click()
txtnum = 0 - txtnum
End Sub
Private Sub cmdEXIT_Click()
End
End Sub
End Sub
To Explain this further my settings include 1 textbox, 18 command buttons (10 are in the array cmdNUM, 4 are in the array cmdOPRTR)
This post has been edited by elstupido: 19 Jul, 2008 - 09:35 AM