How do I add global delay using a remote button to other functions within loop?

Intent; future when completed the 44-button remote will provide colors and different patterns.
I already have some patterns of leds done and they do well by themselfs with a call by pressing one of the DIY remote buttons. So how do I add a common delay to any of these?
I thought adding "int d = 50;" inside the CASE statement for SLOW would work but I get the following error; error: crosses initialization of ‘int d’

All and any comments welcomed.

#include "IRremote.h"
#include <Adafruit_NeoPixel.h>
#define PIN 6

Adafruit_NeoPixel strip = Adafruit_NeoPixel(150, PIN, NEO_GRB + NEO_KHZ800);

int r =0;
int x = 0;
int d = 1;
int b = 0;  
int pos = 0, dir = 1;
int j = 0;
int m = 0;
int TOTAL_LEDS = 150;
int direction=1;

int receiver = 3;

IRrecv irrecv(receiver);  
decode_results results;  

void setup()  
{
  Serial.begin(9600);
  irrecv.enableIRIn(); 
  Serial.println("IR Receiver Raw Data + Button Decode Test");
}

void loop()  
{
  if (irrecv.decode(&results)) 
  {
    irrecv.resume(); 
  } 
  switch(results.value)
  {
  case 0xFF3AC5: 
    Serial.println("Brightness Down");// lowest brightness level
    strip.setBrightness(35);
    strip.begin();
    strip.show();
    break;
  case 0xFFBA45: 
    Serial.println("Brightness Up");// mid-brightness level
    strip.setBrightness(110);
    strip.begin();
    strip.show(); 
    break;
  case 0xFF827D: 
    Serial.println("Play");// high brightness level
    strip.setBrightness(240);
    strip.begin();
    strip.show(); 
    break;
  case 0xFF02FD: 
    Serial.println("Power");
    BLACK();
    /*
    Can not use strip.setBrightness(0)
     as this value of 0 the strip will not restart but a value of 1 does start
     and with "1" the strip is not completely OFF
     */
    break;
  case 0xFF28D7: 
    Serial.println("Red Arrow UP");
    break;
  case 0xFFA857: 
    Serial.println("Green Arrow UP");
    break;
  case 0xFF6897: 
    Serial.println("Blue Arrow UP");
    break;
  case 0xFFE817: 
    Serial.println("QUICK");
    break;
  case 0xFF08F7: 
    Serial.println("Red Arrow Down");
    break;
  case 0xFF8877: 
    Serial.println("Green Arrow Down");
    break;
  case 0xFF48B7: 
    Serial.println("Blue Arrow Down");
    break;
  case 0xFFC837: 
    Serial.println("SLOW");
    int d = 50;
    break;
  case 0xFF30CF: 
    Serial.println("DIY 1");
    DIY1();
    break;
  case 0xFFB04F: 
    Serial.println("DIY 2");
    DIY2();
    break;
  case 0xFF708F: 
    Serial.println("DIY 3");
    break;
  case 0xFFF00F: 
    Serial.println("AUTO");
    break;
  case 0xFF10EF: 
    Serial.println("DIY 4");
    DIY4();
    break;
  case 0xFF906F: 
    Serial.println("DIY 5");
    DIY5();
    break;
  case 0xFF50AF: 
    Serial.println("DIY 6");
    DIY6();
    break;
  default:
    Serial.println(" other button   ");
  }
  delay(100); // original value 500
}




void DIY1()
{ 
  int b = 75; 
  strip.begin();
  strip.show(); 
  strip.setBrightness(100);
  //  does stuff
  delay(d);
}

void DIY2()
{
  strip.begin();
  strip.show(); 
  strip.setBrightness(100);
  //  does stuff
  delay(d);
}

void DIY4()
{
  strip.begin();
  strip.show(); 
  strip.setBrightness(100);
  //  does stuff
  delay(d);
}

void DIY5()
{
  strip.begin();
  strip.show(); 
  strip.setBrightness(100);
  //  does stuff
  delay(d);
}

void DIY6()
{
  strip.begin();
  strip.show(); 
  strip.setBrightness(100);
  //  does stuff
  delay(d);
}

void BLACK()
{
  strip.begin();
  strip.show(); 
  for (int ledNumber=0; ledNumber<TOTAL_LEDS; ledNumber++)
  {
    strip.setPixelColor(ledNumber, 0,0,0);
  }
}

try d=50 instead.

Thank you as that "fixed" my error.
Could you suggest how to capture the value of d so that when I press a button to change the lights patterns ?

case 0xFFC837:
Serial.println("SLOW");
d = 50;
break;

I was hoping that pressing "SLOW" button on the remote would change the value of d within the functions of the DIY's.

any and all comments welcomed

It should do what you want now. Int d is only declared as a global variable and so can be seen by all functions. When you write "int d =10;" you are declaring a new variable and setting an initial value. When you write "d = 10;" you are setting the value of a variable that must be declared somewhere else. When you declare a variable inside a function, it can only be used inside that function. If there is another variable with the same name declared outside of any functions, the locally declared version is used instead of the globally declared version within that function.

Paul

Thank you for explaining that ... at first the "SLOW" did not work and reading your reply a second time I sifted thru the code and found a delay that I specified at 100 which it would read all the time being it was at the end of the Switch-Case loop. Changing the value from 100 to "d" fixed it.

thanks again