VEX Controller Button Delay

I made the the buttons in the 7th and 8th channel make the robot flip it’s direction, but it is not working everything and there seems to be a delay. Please tell me if the part of my code is correct.

int reverse = 1;
while(true){
if(vexRT[Btn7U]){
     if(reverse == 1)
           reverse =-1;
     if(reverse==-1)
           reverse = 1;
// Rest of the code

Both if statements will execute when the button is pressed. Initially reverse will be 1 and changed to -1, then when the second if statement is evaluated reverse will now be -1 and changed back to 1 again.
As a minimum, at least include an else statement before the second if.

int reverse = 1;
while(true){
if(vexRT[Btn7U]){
     if(reverse == 1)
           reverse =-1;
     else
     if(reverse==-1)
           reverse = 1;
// Rest of the code

Also, have a look through this thread as you will need to make sure the reverse variable is only changed once each time you press the button.
https://vexforum.com/t/reply-why-wont-my-task-start/44164/1