CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Math

  1. #1
    Join Date
    Feb 2000
    Location
    garden grove, california
    Posts
    64

    Math

    I am trying to make a program for my math class that msgbox's me the answer. I want text1 for the first number, and i want text2 the variable and text3 the answer. This is a common math problem: 5y = 430
    now how do i msgbox me back what "y" means. First I have to divide text3 with text1. Sorry if this is confusing


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Math

    >Sorry if this is confusing

    well, it is, but I'm going to try to answer anyway :-)

    msgbox "y is " & Text3.Text / Text1.Text


  3. #3
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Re: Math

    this is the code to calculate the y value (what grade are you in? by the way)

    y = Text2 / Text1
    MsgBox y



    Don't forget to trap error (if not a number)
    you can use something like If Not IsNumeric(Text1) then msgbox "not a number"


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

Featured