I have a small question about a program I am writing for my physics test. I have a menu with many equations that you can choose to solve for, the only problem is when I input all of the data the answer is the same as the previous data I had put in and I must go back, type in the same data , and then I will get the correct answer. I think the problem is that the variables are not cleared/refreshed when I start up my program but when I use the delevar function the answer always comes out as zero.
DelVar does indeed remove all {A-Z, theta} variables variables such that the next time you use them, their values are zero. If you DelVar at the beginning of the program (before the menu), it should work out. Can you run your program through SourceCoder and post the code so we can take a look?

Code:
:ClrHome
:Output(3,3,"PHYSICS"
:Output(4,4,"BY:"
:Output(5,5,"PATRICK"
:Output(6,6,"MALONEY")
:
:Pause
:
:Menu("CHOOSE","ESCAPE VEL",A,"FAR GRAVITY",B,"GRAVITY ENERGY",C,"POTENTIAL",D,"KNETIC",E)
:Lbl A
:ClrHome
:
:Input "RADIUS:",R
:Input "MASS OF PLANET:",M
:Disp "ESC VELOCITY:"
:Disp ""
:Disp E
:√(2*(6.67*10^‾11)*M)/R)→E
:
:
:
:Stop
:End
:Lbl C
:ClrHome
:Input "MASS: ",A
:Input "HEIGHT: ",B
:Disp ""
:Disp "ENERGY(J)
:Disp Y
:9.8*A*B→Y
:
:Stop
:End
:Lbl D
:ClrHome
:
:Input "FORCE CONSTANT: ",A
:Input "AMPLITUDE: ",B
:Disp ""
:Disp "ENERGY(J)"
:Disp Z
:((A)*(B2))/2→Z
:Pause
:
:ClrHome
:
:Stop
:End
:Lbl E
:ClrHome
:Input "MASS: ",A
:Input "VELOCITY: ",B
:Disp ""
:Disp "ENERGY(J)"
:Disp Z
:((A)*(B2))/2→Z
:
:Stop
:End
:Lbl B
:ClrHome
:Input "MASS OF OBJ: ",A
:Disp ""
:Disp "ENERGY(J)"
:Disp Z
:((‾6.67*10^‾11))*(6*10^24))*(A))/(6.4*10^6))→Z
:Stop
:End
:ClrHome


^^^^^^^^^^^^^^^^^^^^
There is the code, and by the way thanks a lot for the quick response and care. But I think the problem might be that I stored different equations from different segments from the program as the same variable. I didn't think that that would matter though
lol dammit ignore the smileys !
Never mind I found my mistake. I was putting the display variable function before the computations were even being made. I think I did this because at the time I was getting a syntax error because of it. But as for the delvar fuinction; how do you del var a-z without having to do the DelVar a DelVar b DelVar c........
pattyricks18 wrote:
Never mind I found my mistake. I was putting the display variable function before the computations were even being made. I think I did this because at the time I was getting a syntax error because of it. But as for the delvar fuinction; how do you del var a-z without having to do the DelVar a DelVar b DelVar c........
Sadly, there's no known way to do that other than the most iterative, 52-byte Delvar ADelvar BDelvar CDelvar D.... A small note of forum etiquette (or "netiquette," as we call it): it's generally frowned upon to reply after one's own post within 24 to 36 hours of the original post; this is termed "double-posting". The accepted method of adding information in the thread that you think of after posting is to click the Edit button on your post and add (or remove) your additions. If 24 to 36 hours have passed and no one else has replied, then it is considered acceptable to double-post; in this case, you are bumping the thread such that other people will notice it. Finally, if you wrap [code] tags around your code ([code] at the beginning, then your code, then [ /code] without the space), it will display in a more organized fashion. I have edited your post to use [code] tags.
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement