Author Topic: 65535->r6 results in r6 being 0? (Solved)  (Read 2393 times)

0 Members and 1 Guest are viewing this topic.

Offline unknownloner

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 7
  • Rating: +0/-0
    • View Profile
65535->r6 results in r6 being 0? (Solved)
« on: March 31, 2013, 04:01:56 pm »
Code: [Select]
If r4!=r2
 r4<r2?65535,1->r6
End
FnOff
Disp r6>Dec,i,r2>Dec,i,r4>Dec,i
Repeat getKey(15):End
FnOn
The code above is called within a subroutine. When r4 > r2 is displays r6 as 1. However, when r4 < r2 is displays r6 as 0. In my code I displayed r2 and r4 to make sure that they weren't actually equal. I have a draw interrupt for greyscale:
Code: [Select]
If DrawC++=2
 DispGraph^^r^^r
 0->DrawC
End
Would this be changing the value of r6?
I also tried creating a custom variable and locating it towards the middle of L1, and then using that. That also failed. What am I doing wrong? :banghead:
« Last Edit: March 31, 2013, 05:04:30 pm by unknownloner »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: 65535->r6 results in r6 being 0?
« Reply #1 on: March 31, 2013, 04:15:46 pm »
The line
:r4<r2?65535,1r6
actually means
:If r4<r2
:65535
:Else
:1r6
:End
What you want is
:r4<r2?65535,1
:r6
« Last Edit: March 31, 2013, 04:16:55 pm by Deep Thought »




Offline unknownloner

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 7
  • Rating: +0/-0
    • View Profile
Re: 65535->r6 results in r6 being 0?
« Reply #2 on: March 31, 2013, 04:54:44 pm »
That makes sense, thanks!