PDA

Click to See Complete Forum and Search --> : Easy Calculator:


|2eM!x
Mar 26th, 2005, 12:53 PM
Less than 20 lines of code, thats a good calculator ; )...Check it out

For you lazy bums who dont want to download it:


Option Explicit
Dim x As Integer, y As String, z As Integer, zz As Integer
Dim b As New ScriptControl

Private Sub AC_Click()
Calc.Caption = " "
y = " "
End Sub

Private Sub Cmd_Click(Index As Integer)
x = Calc.Caption
y = Cmd(Index).Caption
End Sub

Private Sub Command1_Click(Index As Integer)

Calc.Caption = Command1(Index).Caption
If Len(x) > 0 Then
Calc.Caption = (b.Eval(x & y & Calc.Caption))
End If
End Sub

Private Sub Form_Load()
b.Language = "vbScript"
End Sub