Limit switches in vexcode

So I’m trying to use limit switches on my lift to stop the motors when the lift is fully extended, how doni program this? I’ve looked through the command reference and found the limit switch commands, but I dont know how to use them.

51%20PM 11%20PM
Both directly from our code

What are you trying to do with this code? From my understanding, this will declare a limit switch on port A when LS2 is pressed.