Using limit switches

ok, im trying to make a lifting arm that can no longer go up when it hits a limit switch but can still go down. how do i program this to work?

**You can do this with IF / ELSE statements. IF a switch is closed, turn a motor Off. ELSE turn motor On. Here is an example from our default code.

 if (rc_dig_in15 == CLOSED)  //When Jumper 15 is on CONFIGURATION C is selected
  {
    pwm07 = pwm02;            //CONFIGURATION C 
    pwm08 = pwm03;
  }
  else                        //CONFIGURATION A & B 
  {
    pwm07 = ~pwm05;
    pwm08 = ~pwm06;
  }

} /* END Default_Routine(); */

**