This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
Omega364


Newbie


Joined: 10 Mar 2009
Posts: 19

Posted: 26 Feb 2011 10:30:11 pm    Post subject:

So im trying to write a program to do a calculus procedure known as Eulers Method. If you don't know what it is doesn't matter. Point is it involves multiple variables. So if you look at it i have it like this:

Code:

Input "Differential =",Str1 // The person would input X+Y for example
Input "Initial X =",X //They would say 1 or something
Input "Initial Y =",Y // They would put it in 1

I can't think of a way to make Str1 go from being "X+Y" to being "2" Or at least producing the number 2 so i can use it later on in the program.

Edit:

Ive been looking into the Expr( and inString( commands can't seem to figure out if they will help me out


Last edited by Guest on 26 Feb 2011 10:33:03 pm; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 27 Feb 2011 10:57:05 am    Post subject:

expr( is exactly what you are looking for ^-^ If Str1 is "X+Y" then doing expr(Str1 you will get the result of X+Y. Another trick that might not be too useful unless you are using expr(Str1 a lot in your program is doing Str1→u (where u is [2nd][7]) and then you can just use 'u' instead of 'expr(Str'. I hope you have fun with your calc stuff! I remember making a program to do that because I could never remember the algorithm Very Happy Programming it always helps me to remember.
Back to top
Omega364


Newbie


Joined: 10 Mar 2009
Posts: 19

Posted: 28 Feb 2011 12:33:38 am    Post subject:

Yes! that works ver nicely thanks mate! although i could get the Str1->u to be successful but oh well, the expr("Str1 is good enough for me. I also solved the problem of adding them together Very Happy Str1+"+"+Str2=Equation+Equation
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 28 Feb 2011 02:51:29 am    Post subject:

Glad to be of assistance ^-^ If you have any other questions, feel free to ask!
Back to top
Deep Thought


Advanced Newbie


Joined: 09 Jun 2009
Posts: 59

Posted: 02 Mar 2011 05:56:30 am    Post subject:

Omega364 wrote:

Yes! that works ver nicely thanks mate! although i could get the Str1->u to be successful but oh well, the expr("Str1 is good enough for me. I also solved the problem of adding them together Very Happy Str1+"+"+Str2=Equation+Equation


If you don't need to display the actual equation, you could use expr(Str1)+expr(Str2[font="Arial"]. It's a lot faster and smaller than
expr(Str1+"+"+Str2[font="Arial"] Smile
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement