Problem about loop with in statement

Hello,

I have a project to setup LED with turn on / off by IR Remote, the button 01 - 05 is static LED (in case 1 to case 5), it can success to turn on or off by press the remote button.

But in the case 6, this is a marquee lighting, when I press button 6, it will start the marquee lighting one times only, then stopped.

I want to set to when I press button 6, it will start the marquee lighting until I press the button 6 again for stop it (or set to other button for stop, it is fine).

Who can help to review my code, where has issue? Thank you very much.

#include <IRremote.h>
int RECV_PIN = A0;
#define code1  0xFF6897  // code received from button 1
#define code2  0xFF9867  // code received from button 2
#define code3  0xFFB04F  // code received from button 3
#define code4  0xFF30CF  // code received from button 4
#define code5  0xFF18E7  // code received from button 5
#define code6  0xFF7A85  // code received from button 6


IRrecv irrecv(RECV_PIN);
decode_results results;

const byte NUM = 5;
const byte Blueled[] = {3, 4, 5, 6, 7}; 
const int RedLED01 = 10;
const int RedLED02 = 11;
const int YellowLED03 = 12;
const int WhiteLED01 = 13;
const int GunplaLED01 = A1;

int itsONled[] = {0, 0, 0, 0, 0, 0, 0, 0};

const int delaytime = 15;
int i;
int blink = 0;
void setup()
{
  Serial.begin(9600);   // you can comment this line
  irrecv.enableIRIn();  // Start the receiver
  pinMode(RedLED01, OUTPUT);
  pinMode(RedLED02, OUTPUT);
  pinMode(YellowLED01, OUTPUT);
  pinMode(YellowLED02, OUTPUT);
  pinMode(YellowLED03, OUTPUT);
  pinMode(WhiteLED01, OUTPUT);

  for (i = 0; i < NUM; i++)
  {
    pinMode(Blueled[i], OUTPUT);
    digitalWrite(Blueled[i], HIGH);
  }
}

void loop() {
  if (irrecv.decode(&results)) {
    unsigned int value = results.value;
    switch (value) {
      //////////////////////////////////////
      case code1:
        if (itsONled[1] == 1) {
          digitalWrite(RedLED01, LOW);
          itsONled[1] = 0;
        } else {
          digitalWrite(RedLED01, HIGH);
          itsONled[1] = 1;
        }
        break;
      //////////////////////////////////////
      case code2:
        if (itsONled[2] == 1) {
          digitalWrite(YellowLED03, LOW);
          itsONled[2] = 0;
        } else {
          digitalWrite(YellowLED03, HIGH);
          itsONled[2] = 1;
        }
        break;
      //////////////////////////////////////
      case code3:
        if (itsONled[3] == 1) {
          digitalWrite(RedLED02, LOW);
          itsONled[3] = 0;
        } else {
          digitalWrite(RedLED02, HIGH);
          itsONled[3] = 1;
        }
        break;
      //////////////////////////////////////
      case code4:
        if (itsONled[4] == 1) {
          digitalWrite(WhiteLED01, LOW);
          itsONled[4] = 0;
        } else {
          digitalWrite(WhiteLED01, HIGH);
          itsONled[4] = 1;
        }
        break;
      //////////////////////////////////////
      case code5:
        if (itsONled[5] == 1) {
          digitalWrite(GunplaLED01, LOW);
          itsONled[5] = 0;
        } else {
          digitalWrite(GunplaLED01, HIGH);
          itsONled[5] = 1;
        }
        break;
      //////////////////////////////////////
      case code6:
          if (itsONled[6] == 0) {
          {
          for (i = 0; i < NUM; i++)
          {
            digitalWrite(Blueled[i], HIGH);
            delay(delaytime);
            digitalWrite(Blueled[i], LOW);
          itsONled[6] = 0;
          }
          }
        } else {
          for (i = 0; i < NUM; i++)
          {
            digitalWrite(Blueled[i], LOW);
            itsONled[6] = 1;
          }
        }
        break;
      //////////////////////////////////////

    }
    Serial.println(value);           // you can comment this line
    irrecv.resume();                 // Receive the next value
  }
}
    unsigned int value = results.value;

The value method of the results struct is not defined as an unsigned int. Storing the unsigned long value in an unsigned int is a mistake and completely unnecessary. Simply switch on results.value.

          for (i = 0; i < NUM; i++)
          {
            digitalWrite(Blueled[i], LOW);
            itsONled[6] = 1;
          }

Why is it necessary to assign 1 to itsONled[6] five times?

What is the value in itsONled[6] the second time button 6 is pressed?

PaulS, thank you very much.

I just use Arduino one month only and never touch C language before, all of my code is copy from Internet then merge to one.

I will try to understanding you comment and change with test on my code. Thanks