Results 1 to 1 of 1

Thread: Easy Calculator:

Threaded View

  1. #1

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Easy Calculator:

    Less than 20 lines of code, thats a good calculator ; )...Check it out

    For you lazy bums who dont want to download it:
    VB Code:
    1. Option Explicit
    2. Dim x As Integer, y As String, z As Integer, zz As Integer
    3. Dim b As New ScriptControl
    4.  
    5. Private Sub AC_Click()
    6.     Calc.Caption = " "
    7.     y = " "
    8. End Sub
    9.  
    10. Private Sub Cmd_Click(Index As Integer)
    11.     x = Calc.Caption
    12.     y = Cmd(Index).Caption
    13. End Sub
    14.  
    15. Private Sub Command1_Click(Index As Integer)
    16.  
    17.  Calc.Caption = Command1(Index).Caption
    18.     If Len(x) > 0 Then
    19.         Calc.Caption = (b.Eval(x & y & Calc.Caption))
    20.     End If
    21. End Sub
    22.  
    23. Private Sub Form_Load()
    24. b.Language = "vbScript"
    25. End Sub
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width