7Seg Display through Shiftregister, Code optimization

Hello can somebody have a look through the following code. It should be possible to control three separated 7Segment Displays with three shiftregisters. The code is working but very long and uncomfortable. Maybe someone has an example for a better solution. Suggestions are very appreciated. And the following code three times for three digits...

Thanx in advance.
regards inside-man

if (outputValue == 1){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B00000110);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 2){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01010011); //X111
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 3){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01000111);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 4){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01100110);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 5){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01101101);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 6){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01111101);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 7){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B00000111);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 8){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01111111);
digitalWrite(LATCH_PIN, HIGH);
}

Create an array of output values.

int out[] = {B00000110, B01010011...};

then replace all of your code with:
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, out[outputValue-1]);
digitalWrite(LATCH_PIN, HIGH);

BTW, what character is this testing for

outputValue == 8)


Rob

Interesting that 8 turned into a smiley - what happened to 0 & 9 tho?