I'm sorry I wasn't clear. I was trying to show you a method, not write your code for you.
Just as I didn't show the device type, clock frequency and necessary include files, I didn't show the needed variable dimensions and port pin assignments. I figured this would be clear, but I assumed a level of knowledge not present. Since MrDEB has been using microcontrollers about the same length of time I have, I thought these things would be self-evident.
It's perfectly valid to test if a port pin is equal to zero to determine if a switch is pressed, but I prefer to make my code more clear by using appropriately named variables for conditions.
Depending on how a switch is arranged, it can be either high or low when pressed. Depending on how an LED is wired, "on" can be either a high or low port pin.
If PortB.0 = 0 then
PortB.1 = 0
End If
Isn't nearly as clear as
If S1 = Pressed then
LED1 = LEDon
End If
That way, I don't have to remember which port pin is what or how things are wired.