Hello all! First time here. Was wondering if someone could answer this for me. I have a program that is behaving unexpectedly.

I’m using a ti 83+ programming in basic...

Here’s a snapshot of the code in question...


Code:
If [J](Y,T)<[J](Y+1,T):Then
1→S
Return
Else
ClrDraw
Text(25,30,”Not Allowed
For(V,1,200
End
ClrDraw
End
Output(Y,X,”


Now the unexpected part...Before the Text() output
My Y value is set to 7
After the text is displayed and the for loop is done I get a domain error for the final output because my Y value is somehow changed to 0

Currently to get around whatever is happening... I can store Y to a different variable, let’s say U, just before the Text line and then store U back to Y just before the final output and everything is fine then. But why on earth would my Y be resetting just because I displayed some text on the graph screen?
The graph screen likes to mess with X and Y, I would advise against using them as variables in general, particularly if you're using graph screen commands like Text(). If you use other variables like A and B, you won't have this problem.
mr womp womp wrote:
The graph screen likes to mess with X and Y, I would advise against using them as variables in general, particularly if you're using the graph screen. If you use other variables like A and B, you won't have this problem.


Thanks so much! Never knew that. First time I’ve encountered this. I’ve always used x and y. Guess I’ll have to change my ways...
Because of the way the TI-OS was programmed, the variables X and more commonly Y typically get changed when messing with the graph screen. More specifically, having the graph displayed after doing a ClrDraw (the graph screen is being displayed here because of your Text() command) resets Y to 0.

As mr womp womp said, just use variables like A and B.
[quote="Michael2_3B"]Because of the way the TI-OS was programmed, the variables X and more commonly Y typically get changed when messing with the graph screen. More specifically, having the graph displayed after doing a ClrDraw (the graph screen is being displayed here because of your Text() command) resets Y to 0.

As mr womp womp said, just use variables like A and B.[/quote]

That’s very interesting... completely understand, though it seems like the ti-os needs some tweaking then. Feel like that shouldn’t happen. Is there some logical reason why it behaves that way? Was the OS made that way intentionally to prevent something catastrophic from happening? I could always rewrite it to display my message on the top line of the home screen as I’m keeping that row open; since it’s just the graph screen that’s acting silly. I just like the transition between the graph and home screens...
I'm not totally sure, but I believe it has to do with the OS preparing to plot any potential graphs.
  
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