Author Topic: Glitches with the "Y" variable?  (Read 4536 times)

0 Members and 1 Guest are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Glitches with the "Y" variable?
« on: March 26, 2010, 09:18:59 pm »
So I'm trying to make a change to one of my convertion programs. I used "Y" to store the value of the y-axis starting point but when I enter it into a For( loop it for some reason resets to zero...I have no idea why this is happening. I can post the code if need be. (By the way, I changed "Y" to "C" and it seemed to work fine...so it is "Y")
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

_player1537

  • Guest
Re: Glitches with the "Y" variable?
« Reply #1 on: March 26, 2010, 09:20:41 pm »
Y is used by the OS ussually to store the Y position for things like "Input".  I believe it is also reset by "ClrDraw".  I would recomend not using Y for anything unless you aren't using the graph screen. 

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6267
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Glitches with the "Y" variable?
« Reply #2 on: March 26, 2010, 09:22:48 pm »
What graph screen commands are you using?
/e

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Glitches with the "Y" variable?
« Reply #3 on: March 26, 2010, 09:30:13 pm »
Well here is the code for it. From what _player said I don't see anything that would reset it. I'm just using pxl-Test( though.

Code: [Select]
This code is the faulty code:
"_→Str1
ClrHome
ClrDraw
AxesOff
FnOff
Prompt X,Y,W,H
Recall 1
For(A,Y,H-1+Y
For(B,X,W-1+X
Str1+sub(" Θ",1+pxl-Test(A,B),1→Str1
End
End
sub(Str1,2,WH→Str1

This code works:
"_→Str1
ClrHome
ClrDraw
AxesOff
FnOff
Prompt X,Y,W,H
Y→C
Recall 1
For(A,C,H-1+C
For(B,X,W-1+X
Str1+sub(" Θ",1+pxl-Test(A,B),1→Str1
End
End
sub(Str1,2,WH→Str1
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Glitches with the "Y" variable?
« Reply #4 on: March 26, 2010, 09:41:31 pm »
yeah Y has issues being reset by some graph commands. I think it's a TI-OS glitch. Very annoying when you don't know it, during debugging. I learned the hard way.

The solution is to never use Y altogether unless you never use the graph screen commands

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Glitches with the "Y" variable?
« Reply #5 on: March 26, 2010, 09:45:13 pm »
Ah ok. Well makes sense and yes it is quite annoying :P

By the way, DJ, is that the kind of effect you were looking for? (Try the second code)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Glitches with the "Y" variable?
« Reply #6 on: March 26, 2010, 09:54:02 pm »
yep it appears to be so ^^

Nice

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Glitches with the "Y" variable?
« Reply #7 on: March 26, 2010, 10:04:51 pm »
Ok, sweet :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)