slinga
Established Member
if((data & pad_asign[1])== 0)
cursor = cursor++%7;
if((data & pad_asign[0])== 0)
cursor = (cursor--)%7;
How come the first code doesn't work properly, but the second set does?
Cursor is just some test I'll display next to each option in the menu. When the user hits down, the cursor moves down a line, when the user hits up, the cursor moves up. I also wanted the cursor to wrap, meaning if your at the top and you hit up, you reach the bottom. Hence why I used mod. This isn't urgent seeing how I have a work around, but it's bugging me. Thanks in advance.
if((data & pad_asign[1])== 0)
cursor = (cursor+1)%7;
if((data & pad_asign[0])== 0)
{
cursor = (cursor-1)%7;
if(cursor<0)
cursor = 6;
}