Relays and Switch Case

I am trying to make one momentary pushbutton activate four OMR-C-105H relays using an Arduino Micro. With each press the next relay is activated and the others inactive. The relays are functioning properly and seems to be a problem of getting the digital pins to go HIGH. I am not sure where i'm going wrong. They seem to activate in addition to one another rather than one at a time. Anyone have any ideas? Code that I have so far..What the... Relays? - Pastebin.com

What is this:

if(D | 1 | 2 | 3)

Do you want to check if 'D' is 1,2 or 3 ? Did you forget 4 ?

if( D==1 || D==2 || D==3 || D==4)

I don't understand what variable 'B' is doing.

Now the relays run one at a time but then stop after four button presses (attempting to have them roll over back to one from relay 4). In addition I am trying to have relay 1 activated from the start. Also I don't understand what variable B is doing. I am playing around with code in a (poor) attempt to get this working. The whole point of this is to have one momentary switch replicate a 4-way slide switch. Also also, thank you for your help so far.

Please post your code between the [code] ... [/code] tags.

Perhaps you can write code that uses only the serial monitor.
Try to make a small sketch that detects if a button is pressed (send a single message to the serial monitor, regardless how long the button is pressed). If you upload it, I can have a look at it.
After that make a variable that switches like 1,2,3,4.
After that add the relays.
After that implement a debounce for the button.

Here is an easy way to do it:

const int buttonPin = 3;    // pin to read button
const int mode1 = 2;       // relay 1
const int mode2 = 4;     // relay 2
const int mode3 = 7;       // relay 3
const int mode4 = 8;     // relay 4
int state = 1;           // Which relay is currently on.
 
void setup()
{
  pinMode(buttonPin, INPUT);
  pinMode(mode1, OUTPUT);
  pinMode(mode2, OUTPUT);
  pinMode(mode3, OUTPUT);
  pinMode(mode4, OUTPUT);
  digitalWrite(mode1, HIGH);
}
 
void loop()
{
  if( digitalRead(buttonPin) ) {
   
    // debounce
    delay(200);
    
    if (state == 1) {
      digitalWrite(mode1, LOW);
      state = 2;
      digitalWrite(mode2, HIGH);
    }
    else if (state == 2) {
      digitalWrite(mode2, LOW);
      state = 3;
      digitalWrite(mode3, HIGH);
    }
    else if (state == 3) {
      digitalWrite(mode3, LOW);
      state = 4;
      digitalWrite(mode4, HIGH);
    }
    else if (state == 4) {
      digitalWrite(mode4, LOW);
      state = 1;
      digitalWrite(mode1, HIGH);
    }
    while(digitalRead(buttonPin));  // wait until the button is released
    delay(200);      // debounce
  }
}
const int buttonPin = 3;
int D = 0;
int B = 0; //Counts the button presses

void setup()
{
Serial.begin(9600);
  pinMode(buttonPin, INPUT);
}

void loop()
{
  B = digitalRead(buttonPin);
  B = D++;
  if(digitalRead(buttonPin))
  {
    delay(200); 
  } 
Serial.println(D);
}

is set up to count the number of button presses. It shouldnt matter how long the button is pressed, I am setting up LED indicator lights to show which relay is on. The main issue with my first set of code is having it revert to the first relay after the fourth one is deactivated. I might be confused but the code that I had written switched the relays 1,2,3,4. It simply wouldnt revert to the 1st relay after the fourth and wouldnt start with the first relay activated.

TanHadron's code is almost exactly what I need. I'm going to tinker around with it until 'mode1' is on from the start (it really needs to go HIGH - LOW - HIGH - LOW (I am programming an arcade machine for my kids and every time the button PCB is powered off it needs two presses from a momentary switch to activate the selected setting from a four way slide selector switchhttp://www.xgaming.com/store/arcade-parts-and-accessories/product/x-arcade-byo-arcade-usb-ps2/)). Thanks for all of your help!