Subroutine question and possible compiler help

hey everyone, I've been working on this code and have almost got it done and squared away. Just have 1 issue that seems to be holding me up. I'm basically using a binary input to control multiple outputs. I'm trying to add a password, only 4 digits, to the beginning of the code and i think i have that bit squared away. I moved my switching commands themselves to a subroutine and I believe that is correct but I am having issues compiling it. Every time I attempt to compile I receive this error...

"error: a function-definition is not allowed here before '{' token"

any help anyone can give me would be beyond appreciated.

int inPin1 = 0;      //Input from DTMF Decoder
int inPin2 = 1;      //Input from DTMF Decoder
int inPin3 = 2;      //Input from DTMF Decoder
int inPin4 = 3;      //Input from DTMF Decoder
int outPin1 = 45;    //output for Device 1
int outPin2 = 44;    //Output for Device 2
int outPin3 = 43;    //Output for Device 3
int outPin4 = 42;    //Output for Device 4
int lockPin1 = 23;   //Lock Pin for Device 1
int lockPin2 = 22;   //Lock Pin for Device 2
int lockPin3 = 21;   //Lock Pin for Device 3
int lockPin4 = 20;   //Lock Pin for Device 4
int engagePin = 40;
  
void setup ()  
{ //Set Input assignments for Pins
  pinMode (inPin1, INPUT);       //Most Signifacant Bit
  pinMode (inPin2, INPUT);       //
  pinMode (inPin3, INPUT);       //
  pinMode (inPin4, INPUT);       //Most Significant Bit
  //Set Output assignments for Pins
  pinMode (outPin1, OUTPUT);     //Device number 1
  pinMode (outPin2, OUTPUT);     //Device number 2
  pinMode (outPin3, OUTPUT);
  pinMode (outPin4, OUTPUT);
  pinMode (lockPin1, OUTPUT);    //lockPin1 for Device 1
  pinMode (lockPin2, OUTPUT);    //lockPin2 for Device 2
  pinMode (lockPin3, OUTPUT);
  pinMode (lockPin4, OUTPUT);
  pinMode (engagePin, OUTPUT);

void doSwitching (void) //Switching subroutine
{
  //Switching commands for devices on pins 45 & 42
  //Start switching Commands
  if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH || lockPin1 == HIGH)  //Binary 1
  {  
     digitalWrite (outPin1, HIGH) && digitalWrite (lockPin1, HIGH); //Set lockPin1 and outPin1 HIGH
  }
  else if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 2
  {
      digitalWrite (outPin1, LOW) && digitalWrite (lockPin1, LOW);  //Reset lockPin1 and outPin1 LOW
  }
  else if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == HIGH || lockPin2 == HIGH)  //Binary 3
  {  
     digitalWrite (outPin2, HIGH) && digitalWrite (lockPin2, HIGH); //Set lockPin2 and outPin2 HIGH
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == LOW && inPin4 == LOW)  //Binary 4
  {
     digitalWrite (outPin2, LOW) && digitalWrite (lockPin2, LOW); //Reset lockPin2 and outPin2 LOW 
  }  
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == LOW && inPin4 == HIGH || lockPin3 == HIGH)  //Binary 5
  {  
     digitalWrite (outPin3, HIGH) && digitalWrite (lockPin3, HIGH); //Set lockPin3 and outPin3 HIGH
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == HIGH && inPin4 == LOW)  //Binary 6
  {
     digitalWrite (outPin3, LOW) && digitalWrite (lockPin3, LOW); //Set lockPin3 and outPin3 LOW
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == HIGH && inPin4 == HIGH || lockPin4 == HIGH) //Binary 7
  {  
     digitalWrite (outPin4, HIGH) && digitalWrite (lockPin4, HIGH); //Set lockPin4 and outPin4 HIGH
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == LOW && inPin4 == LOW)   //Binary 8
   {
     digitalWrite (outPin4, LOW) && digitalWrite (lockPin4, LOW); //Set lockPin4 and outPin4 
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 9
   { //When a Binary 9 registers shut off ALL attached devices 
     digitalWrite (outPin1, LOW) && digitalWrite (lockPin1, LOW) && digitalWrite (outPin2, LOW) && digitalWrite (lockPin2, LOW); 
     digitalWrite (outPin3, LOW) && digitalWrite (lockPin3, LOW) && digitalWrite (outPin4, LOW) && digitalWrite (lockPin4, LOW); 
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 10, keypad 0
   {
     //Do nothing
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == HIGH && inPin4 == HIGH)  //Binary 11, keypad *
   {
     //Do nothing
   }
   else if (inPin1 == HIGH && inPin2 == HIGH && inPin3 == LOW && inPin4 == LOW)  //Binary 12, keypad #
   {
     //Do nothing
   }
   else //Default for when device is first activated. Sets all attached devices in Off mode.
   {
     digitalWrite (outPin1, LOW) && digitalWrite (outPin2, LOW) && digitalWrite (outPin3, LOW) && digitalWrite (outPin4, LOW);
     digitalWrite (lockPin1, LOW) && digitalWrite (lockPin2, LOW) && digitalWrite (lockPin3, LOW) && digitalWrite (lockPin4, LOW);
   }
}

void loop ()  //Main Passwrod Loop
{ 
  //Binary input from 8870 Chip
  inPin1 = digitalRead(0) && inPin2 = digitalRead(1) && inPin3 = digitalRead(2) && inPin4 = digitalRead(3);
  //read statements for state lock on outputs
  lockPin1 = digitalRead(23) && lockPin2 = digitalRead(22) && lockPin3 = digitalRead(21) && lockPin4 = digitalRead(20);
  enagePin = digitalRead(40);
    //Password setting
  if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 1
  {
    if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 1
    {
      if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 1
      {
        if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 1
        {  
          digitalWrite (engagePin, HIGH);
          digitalWrite (outPin1, LOW) && digitalWrite (lockPin1, LOW) && digitalWrite (outPin2, LOW) && digitalWrite (lockPin2, LOW); 
          digitalWrite (outPin3, LOW) && digitalWrite (lockPin3, LOW) && digitalWrite (outPin4, LOW) && digitalWrite (lockPin4, LOW);
          doSomething (); 
        }
        else
        {
          digitalWrite (engagePin, LOW);
        }
      }
      else
      {
        digitalWrite (engagePin, LOW);
      }
    }
    else
    {
      digitalWrite (engagePin, LOW);
    }
  }
  else
  {
    digitalWrite (engagePin, LOW);
  }
}

Missing a "}" after the last "pinMode" before "void doSwitching"

Then you're going to have problems with :

     digitalWrite (outPin1, HIGH) && digitalWrite (lockPin1, HIGH);

What are you trying to do here?

have almost got it done and squared away

Sorry, you've got a way to go.

You've got repeated constructs like: inPin1 = digitalRead(0) && inPin2 = digitalRead(1) && inPin3 = digitalRead(2) && inPin4 = digitalRead(3);You're confusing bitwise AND with logical AND with simple sequencing.

I think a lot was explained here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1270666137/9#9

Analysis: if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH || lockPin1 == HIGH)
translates to:

 if (0 == LOW && 1 == LOW && 2 == LOW && 3 == HIGH || 23 
== HIGH)

Now, solve for "HIGH = 1", "LOW = 0"

A lot was explained in my previous post. I did correct the && and the { mistake. Thought that I could do the && and slim up the code some but no dice. I have it compiling now but for some reason the code does not pass to the doSwitching subroutine. I am trying to have it setup so that once the password 1234 is entered it will pass to the subroutine and then start switching.

//initiate pins
int inPin1 = 0;      //Input from DTMF Decoder
int inPin2 = 1;      //Input from DTMF Decoder
int inPin3 = 2;      //Input from DTMF Decoder
int inPin4 = 3;      //Input from DTMF Decoder
int outPin1 = 45;    //output for Device 1
int outPin2 = 44;    //Output for Device 2
int outPin3 = 43;    //Output for Device 3
int outPin4 = 42;    //Output for Device 4
int lockPin1 = 23;   //Lock Pin for Device 1
int lockPin2 = 22;   //Lock Pin for Device 2
int lockPin3 = 21;   //Lock Pin for Device 3
int lockPin4 = 20;   //Lock Pin for Device 4
int engagePin = 41;
  
void setup ()  
{ //Set Input assignments for Pins
  pinMode (inPin1, INPUT);       //Most Signifacant Bit
  pinMode (inPin2, INPUT);       //
  pinMode (inPin3, INPUT);       //
  pinMode (inPin4, INPUT);       //Most Significant Bit
  //Set Output assignments for Pins
  pinMode (outPin1, OUTPUT);     //Device number 1
  pinMode (outPin2, OUTPUT);     //Device number 2
  pinMode (outPin3, OUTPUT);
  pinMode (outPin4, OUTPUT);
  pinMode (lockPin1, OUTPUT);    //lockPin1 for Device 1
  pinMode (lockPin2, OUTPUT);    //lockPin2 for Device 2
  pinMode (lockPin3, OUTPUT);
  pinMode (lockPin4, OUTPUT);
  pinMode (engagePin, OUTPUT);
}
void loop ()  //Main Passwrod Loop
{ 
  //Binary input from 8870 Chip
  inPin1 = digitalRead(0);
  inPin2 = digitalRead(1);
  inPin3 = digitalRead(2);
  inPin4 = digitalRead(3);
  //read statements for state lock on outputs
  lockPin1 = digitalRead(23);
  lockPin2 = digitalRead(22);
  lockPin3 = digitalRead(21);
  lockPin4 = digitalRead(20);
  engagePin = digitalRead(41);
  //Password setting
  if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 1
  {
    if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 1
    {
      if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == HIGH)  //Binary 1
      {
        if (inPin1 == LOW && inPin2 == HIGH && inPin3 == LOW && inPin4 == LOW)  //Binary 1
        {  
          digitalWrite (engagePin, HIGH);
          digitalWrite (outPin1, LOW);
          digitalWrite (lockPin1, LOW);
          digitalWrite (outPin2, LOW);
          digitalWrite (lockPin2, LOW); 
          digitalWrite (outPin3, LOW);
          digitalWrite (lockPin3, LOW);
          digitalWrite (outPin4, LOW);
          digitalWrite (lockPin4, LOW);
          doSwitching (); 
        }
        else
        {
          digitalWrite (engagePin, LOW);
        }
      }
      else
      {
        digitalWrite (engagePin, LOW);
      }
    }
    else
    {
      digitalWrite (engagePin, LOW);
    }
  }
  else
  {
    digitalWrite (engagePin, LOW);
  }
}

void doSwitching () //Switching subroutine
{
    //Binary input from 8870 Chip
  inPin1 = digitalRead(0);
  inPin2 = digitalRead(1);
  inPin3 = digitalRead(2);
  inPin4 = digitalRead(3);
  //read statements for state lock on outputs
  lockPin1 = digitalRead(23);
  lockPin2 = digitalRead(22);
  lockPin3 = digitalRead(21);
  lockPin4 = digitalRead(20);
  engagePin = digitalRead(40);
  //Switching commands for devices on pins 45 & 42
  //Start switching Commands
  if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH || lockPin1 == HIGH)  //Binary 1
  {  
     digitalWrite (outPin1, HIGH);
     digitalWrite (lockPin1, HIGH); //Set lockPin1 and outPin1 HIGH
  }
  else if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 2
  {
      digitalWrite (outPin1, LOW);
      digitalWrite (lockPin1, LOW);  //Reset lockPin1 and outPin1 LOW
  }
  else if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == HIGH || lockPin2 == HIGH)  //Binary 3
  {  
     digitalWrite (outPin2, HIGH);
     digitalWrite (lockPin2, HIGH); //Set lockPin2 and outPin2 HIGH
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == LOW && inPin4 == LOW)  //Binary 4
  {
     digitalWrite (outPin2, LOW);
     digitalWrite (lockPin2, LOW); //Reset lockPin2 and outPin2 LOW 
  }  
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == LOW && inPin4 == HIGH || lockPin3 == HIGH)  //Binary 5
  {  
     digitalWrite (outPin3, HIGH);
     digitalWrite (lockPin3, HIGH); //Set lockPin3 and outPin3 HIGH
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == HIGH && inPin4 == LOW)  //Binary 6
  {
     digitalWrite (outPin3, LOW);
     digitalWrite (lockPin3, LOW); //Set lockPin3 and outPin3 LOW
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == HIGH && inPin4 == HIGH || lockPin4 == HIGH) //Binary 7
  {  
     digitalWrite (outPin4, HIGH);
     digitalWrite (lockPin4, HIGH); //Set lockPin4 and outPin4 HIGH
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == LOW && inPin4 == LOW)   //Binary 8
   {
     digitalWrite (outPin4, LOW);
     digitalWrite (lockPin4, LOW); //Set lockPin4 and outPin4 
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 9
   { //When a Binary 9 registers shut off ALL attached devices 
     digitalWrite (outPin1, LOW);
     digitalWrite (lockPin1, LOW);
     digitalWrite (outPin2, LOW);
     digitalWrite (lockPin2, LOW); 
     digitalWrite (outPin3, LOW);
     digitalWrite (lockPin3, LOW);
     digitalWrite (outPin4, LOW);
     digitalWrite (lockPin4, LOW); 
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 10, keypad 0
   {
     //Do nothing
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == HIGH && inPin4 == HIGH)  //Binary 11, keypad *
   {
     //Do nothing
   }
   else if (inPin1 == HIGH && inPin2 == HIGH && inPin3 == LOW && inPin4 == LOW)  //Binary 12, keypad #
   {
     //Do nothing
   }
   else //Default for when device is first activated. Sets all attached devices in Off mode.
   {
     digitalWrite (outPin1, LOW);
     digitalWrite (lockPin1, LOW);
     digitalWrite (outPin2, LOW);
     digitalWrite (lockPin2, LOW); 
     digitalWrite (outPin3, LOW);
     digitalWrite (lockPin3, LOW);
     digitalWrite (outPin4, LOW);
     digitalWrite (lockPin4, LOW);
   }
}

But you're logic is completely wrong; you're confusing the number of a pin, and the value you've read from it, and what's worse, you're changing the values of the pin numbers.

See my last reply, read it through.

Keep consistent.

I think it is possible to get the compiler to show up some of the places where you're going to have difficulties, simply by putting the keyword "const" in front to all those "int inPin", "int outPin" and "int lockPin".

Can I suggest that you take a deep breath, and chuck out all the code you've written, and just write a simple sketch that echoes the decimal value of the DTMF code to the serial port?
Shouldn't be more than about 20 lines of code.
Once you've got that working, the rest will come quickly.

Slow down - you're trying to compete in the 100m final, before you've learnt to crawl.

20 lines of code (uncompiled, untested):

const byte inPin [] = {0, 1, 2, 3};   // May need to be reversed - depends which is most/least significant
#define SIZE_ARRAY(x) (sizeof (x)/sizeof (x[0])
  
void setup ()  
{ 
  for (int i = 0; i < SIZE_ARRAY(inPin); i++) {
    pinMode (inPin [i], INPUT);     
  }
  Serial.begin (9600);
}

void loop ()
{
  byte DTMFcode = 0;
  for (int i = 0; i < SIZE_ARRAY (inPin); i++) {
    DTMFcode |= digitalRead (inPin [i]) << i;
  }
  Serial.println (DTMFcode, HEX);
}

i would load through the serial connection however the DTMF signal is coming directly out of a DTMF Decoder circuit. I have one chunk of the code that works perfect as it is right now

void doSwitching () //Switching subroutine
{
    //Binary input from 8870 Chip
  inPin1 = digitalRead(0);
  inPin2 = digitalRead(1);
  inPin3 = digitalRead(2);
  inPin4 = digitalRead(3);
  //read statements for state lock on outputs
  lockPin1 = digitalRead(23);
  lockPin2 = digitalRead(22);
  lockPin3 = digitalRead(21);
  lockPin4 = digitalRead(20);
  //Switching commands for devices on pins 45 & 42
  //Start switching Commands
  if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH || lockPin1 == HIGH)  //Binary 1
  {  
     digitalWrite (outPin1, HIGH);
     digitalWrite (lockPin1, HIGH); //Set lockPin1 and outPin1 HIGH
  }
  else if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 2
  {
      digitalWrite (outPin1, LOW);
      digitalWrite (lockPin1, LOW);  //Reset lockPin1 and outPin1 LOW
  }
  else if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == HIGH || lockPin2 == HIGH)  //Binary 3
  {  
     digitalWrite (outPin2, HIGH);
     digitalWrite (lockPin2, HIGH); //Set lockPin2 and outPin2 HIGH
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == LOW && inPin4 == LOW)  //Binary 4
  {
     digitalWrite (outPin2, LOW);
     digitalWrite (lockPin2, LOW); //Reset lockPin2 and outPin2 LOW 
  }  
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == LOW && inPin4 == HIGH || lockPin3 == HIGH)  //Binary 5
  {  
     digitalWrite (outPin3, HIGH);
     digitalWrite (lockPin3, HIGH); //Set lockPin3 and outPin3 HIGH
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == HIGH && inPin4 == LOW)  //Binary 6
  {
     digitalWrite (outPin3, LOW);
     digitalWrite (lockPin3, LOW); //Set lockPin3 and outPin3 LOW
  }
  else if (inPin1 == LOW && inPin2 == HIGH && inPin3 == HIGH && inPin4 == HIGH || lockPin4 == HIGH) //Binary 7
  {  
     digitalWrite (outPin4, HIGH);
     digitalWrite (lockPin4, HIGH); //Set lockPin4 and outPin4 HIGH
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == LOW && inPin4 == LOW)   //Binary 8
   {
     digitalWrite (outPin4, LOW);
     digitalWrite (lockPin4, LOW); //Set lockPin4 and outPin4 
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 9
   { //When a Binary 9 registers shut off ALL attached devices 
     digitalWrite (outPin1, LOW);
     digitalWrite (lockPin1, LOW);
     digitalWrite (outPin2, LOW);
     digitalWrite (lockPin2, LOW); 
     digitalWrite (outPin3, LOW);
     digitalWrite (lockPin3, LOW);
     digitalWrite (outPin4, LOW);
     digitalWrite (lockPin4, LOW); 
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 10, keypad 0
   {
     //Do nothing
   }
   else if (inPin1 == HIGH && inPin2 == LOW && inPin3 == HIGH && inPin4 == HIGH)  //Binary 11, keypad *
   {
     //Do nothing
   }
   else if (inPin1 == HIGH && inPin2 == HIGH && inPin3 == LOW && inPin4 == LOW)  //Binary 12, keypad #
   {
     //Do nothing
   }
   else //Default for when device is first activated. Sets all attached devices in Off mode.
   {
     digitalWrite (outPin1, LOW);
     digitalWrite (lockPin1, LOW);
     digitalWrite (outPin2, LOW);
     digitalWrite (lockPin2, LOW); 
     digitalWrite (outPin3, LOW);
     digitalWrite (lockPin3, LOW);
     digitalWrite (outPin4, LOW);
     digitalWrite (lockPin4, LOW);
   }
}

When that part is the main loop it operates in the manner that I need. Where i am getting stuck at is my "Password" that I am trying to add to it. I am setting this password function as the main loop and the switching function as a subroutine.

void loop ()  //Main Password Loop
{ 
  //Binary input from 8870 Chip
  inPin1 = digitalRead(0);
  inPin2 = digitalRead(1);
  inPin3 = digitalRead(2);
  inPin4 = digitalRead(3);
  //read statements for state lock on outputs
  lockPin1 = digitalRead(23);
  lockPin2 = digitalRead(22);
  lockPin3 = digitalRead(21);
  lockPin4 = digitalRead(20);
  engagePin = digitalRead(41);
  //Password setting
  if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 1
  {
    if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 1
    {
      if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == HIGH)  //Binary 1
      {
        if (inPin1 == LOW && inPin2 == HIGH && inPin3 == LOW && inPin4 == LOW)  //Binary 1
        {  
          digitalWrite (engagePin, HIGH);
          digitalWrite (outPin1, LOW);
          digitalWrite (lockPin1, LOW);
          digitalWrite (outPin2, LOW);
          digitalWrite (lockPin2, LOW); 
          digitalWrite (outPin3, LOW);
          digitalWrite (lockPin3, LOW);
          digitalWrite (outPin4, LOW);
          digitalWrite (lockPin4, LOW);
          doSwitching (); 
        }
        else
        {
          digitalWrite (engagePin, LOW);
        }
      }
      else
      {
        digitalWrite (engagePin, LOW);
      }
    }
    else
    {
      digitalWrite (engagePin, LOW);
    }
  }
  else
  {
    digitalWrite (engagePin, LOW);
  }
}

(The engagePin is hooked into an AND gate that is tied to my outputs.) I know that I have something obvious wrong in this part as it is not functioning at all. Ideally I want it setup so that once the 4 correct DTMF signals are detected in the proper sequence it will branch to the switching function. And that if they are not correct it does not branch.

i would load through the serial connection however the DTMF signal is coming directly out of a DTMF Decoder circuit

I don't understand what you mean by this.

Did you try Groove's test program?

How do you ever expect this:

 if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 1
  {
    if (inPin1 == LOW && inPin2 == LOW && inPin3 == HIGH && inPin4 == LOW)  //Binary 1

to work?
inPin3 can't be both LOW and HIGH simultaneously, neither can inPin4.

I did try Grooves program and it did work, it performed the same as my code so my group and I decided to keep mine. There is a DTMF Decoder Chip on the development board that the TEENSY++ is on. We are decoding the tones generated by the phone keys to switch on and off devices with the teensy. The DTMF Chip has 4 outputs that decode that represent a binary output. I have these 4 outputs wired into 4 inputs on the teensy and we are looking for particular HIGHs and LOWs that represent a key press on the phone. Basically making it so you can call the phone attached to the Board and press keypad buttons to switch on and off certain outputs. Binary 1 and 2 turn on and off one outputs and so on.

it performed the same as my code

But isn't it easier to deal with simple numbersif (code == 1), rather than

 if (inPin1 == LOW && inPin2 == LOW && inPin3 == LOW && inPin4 == HIGH)  //Binary 1

?

For our switching statement it would be. For our password we are looking at making it user changeable by adjusting dip switches on an attached board. I was planning to do an overall slim down after I had the entire code functioning.

Your "slim-down" would be less of a task if you had debugged, simple, lean code already in place.

lockPin1 = digitalRead(23);
  lockPin2 = digitalRead(22);
  lockPin3 = digitalRead(21);
  lockPin4 = digitalRead(20);
  engagePin = digitalRead(41);

// lots of "if" statements snipped

          digitalWrite (engagePin, HIGH);
          digitalWrite (outPin1, LOW);
          digitalWrite (lockPin1, LOW);
          digitalWrite (outPin2, LOW);
          digitalWrite (lockPin2, LOW

Uh-oh...

I have one chunk of the code that works perfect as it is right now

You're kidding, right?

Here you go, a kick-start; I'm in a good mood today: (compiled but untested

// NB the order of the elements in these arrays may need changing to reflect
// how "readCode" works. Or change how readCode works ;-)
const byte inPin[]   = {0, 1, 2, 3};      //Input from DTMF Decoder
const byte outPin[]  = {45, 44, 43, 43};  //output for Device 
const byte lockPin[] = {23, 22, 21, 20};  //Lock Pin for Device 
const byte engagePin [] = {40};
#define SIZE(x) (sizeof(x)/sizeof(x[0]))
  
void setPins  (const byte* pinArray, int nPins, int mode)
{
  for (int i = 0; i < nPins; i++) {
    pinMode (pinArray [i], mode);
  }
}

void setup ()  
{ 
  setPins (inPin, SIZE(inPin), INPUT);     
  setPins (outPin, SIZE(outPin), OUTPUT);
  setPins (lockPin, SIZE (lockPin), INPUT); 
  setPins (engagePin, SIZE(engagePin), OUTPUT);
}

byte readCode (const byte* pinArray, int nPins)
{
  byte code = 0;
  for (int i = 0; i < nPins; i++) {
    code <<= 1;
    code |= digitalRead(pinArray [i]);  // add in the next LSB
  }  
  return code;
}

void doSwitching () 
{
  byte inCode    = readCode (inPin, SIZE (inPin));
  byte lockCode = readCode (lockPin, SIZE (lockPin));
  // the rest is down to you.

}