GOTO command

Thank you all of you guys.
I'm working to make a RGB strip controlled by a joystick.The xPosition controls the "program" (colors and sequence) and the yPosition controls the intensity. This part needs to be implemented yet.

It might not be the cleaner code, I'm sure there are better ways to do this but is working and eventually can improve the code.

Needed the GOTO in order to get out of the loops without delay when I move the joystick.

void switch_to_value_100 ()
{
  bool bailout = false;
  for (i = 0; i <= 255; i ++)
  {
    analogWrite(ledR, i);
    analogWrite(ledG, LOW);
    analogWrite(ledB, LOW);
    Serial.println(" ");
    Serial.print(programSelector);
    Serial.print(" Red Transition ");
    //    Serial.print(" i= ");
    //    Serial.print(i);
    xPosition = analogRead(xPin);
    if (xPosition >= 540) {     // bail out on sensor detect
      i = 0;
      programSelector = programSelector - 1;
      
      goto bailout;
    }
    if (xPosition <= 480) {     // bail out on sensor detect
      i = 0;
      programSelector = programSelector + 1;
      
      goto bailout;
    }
  }
  delay(1000);
  for (i = 255; i >= 0; i--) {
    analogWrite(ledR, i);
    analogWrite(ledG, LOW);
    analogWrite(ledB, LOW);
    Serial.println(" ");
    Serial.print(programSelector);
    Serial.print(" Red Transition ");
    //    Serial.print(" i= ");
    //    Serial.print(i);
    xPosition = analogRead(xPin);
    if (xPosition >= 540)  {
      programSelector = programSelector - 1;
      i = 0;
      
      goto bailout;
    }
    if (xPosition <= 480) {     // bail out on sensor detect
      i = 0;
      programSelector = programSelector + 1;
      

      goto bailout;
    }
  }
bailout:
  Serial.println("works");
  Serial.println(programSelector);

  delay(1500);
}