Results 1 to 17 of 17

Thread: division in text box

Hybrid View

  1. #1
    Lively Member
    Join Date
    Jun 2005
    Posts
    81

    Re: division in text box

    and yet another way...

    Code:
    Private Sub CommandButton1_Click()
    Dim dividend As String
    Dim divisor As String
    Dim info As String
    Dim Split As Integer
    
    ' Start with this.
    info = TextBox1.Text
    ' Find the Division.
    Split = InStr(1, info, "/", vbTextCompare)
    
    dividend = Left(info, Split - 1)
    
    divisor = Right(info, Split + 1)
    Label1.Caption = dividend / divisor
    
    End Sub
    It's all about Attitude!

  2. #2
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    499

    Re: division in text box

    And another.
    Code:
    'project >> references >> microsoft script control 1.0
    
    Dim msc As New MSScriptControl.ScriptControl
    
    msc.Language = "vbscript"
    
    Debug.Print msc.Eval(Text1.Text)

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