help on eval

Discussion in 'Questions (Windows Mobile)' started by robert black, Dec 5, 2008.

  1. robert black

    robert black Member Licensed User

    Sub Globals

    End Sub

    Sub App_Start
    Form1.Show
    End Sub

    Sub Button1_Click
    textbox1.Text="5*(4+8)/-21"
    s=textbox1.Text
    msgbox((s))
    textbox2.Text=(s)
    end sub

    can anyone please explian why on the first pass this works as expected showing
    answer in both msgbox and textbox2 but on second click format exception error on the varible 's' occurs
    i thought that as declaring 's' only in the 'click' sub it would be discarded after use
    then reinitialised on subsequent clicks of 'button1'

    look forward to reply
    please note parentheses around 's' at msgbox and textbox2
    seems to evaluate equation
    rb
     
    Last edited: Dec 5, 2008
  2. Erel

    Erel Administrator Staff Member Licensed User

    This approach will not work.
    You can use the Eval module which is part of the solver example.
     

    Attached Files:

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice