Results 1 to 14 of 14

Thread: [RESOLVED] Using variables to store equations

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    4

    Re: Using variables to store equations

    none of my past attempts were any good, but to give you a better picture lets say:

    I type "x+y^2" (or any other equation) into TextBox1 then when Command1 is pressed it displayed an answer in Label1 if "x" is a value I typed in TextBox2 and "y" was a value in TextBox3. How could I use any formula (with Xs and Ys in) typed in TextBox1 along with the values of x and y to give answer.
    ie.

    Dim y as Single
    Dim x as Single
    Dim strEquation as String

    strEquation = TextBox1
    y = TextBox3
    x = TextBox2
    Label1 = strEquation 'But this needs to be whatever the equation is...

  2. #2
    Fanatic Member
    Join Date
    Aug 2005
    Posts
    606

    Re: Using variables to store equations

    ok I think I see what you want to do:

    1)You'll have to parse the string in text1
    2) then use some conditional statements to convert x to what is in text2 and convert y to what is in text3. Hopefully text2.text & text3.text are integers
    3) label1.caption = strEquation

    Try looking into the Mid & InStr functions for the parsing
    Life is about making some things happen, not waiting around for something to happen.

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