How to set motor power as a variable?

So im builing a robot with an arm an want to have a limit switch on it so i dont strip any gears when i lift it all the way up. now when that limit switch is hit he user should still have control but the program cant let t go up once the switch is pressed. i dont know how to do this and am hoping someone will know any ideas for different aproaches would be apreciated as well.
-NNfuller- STANFORD CAN TAKE CARNEGIE MELLON ANY DAY!!!:stuck_out_tongue:

See this post the answer is almost the same…

https://vexforum.com/t/motor-as-a-variable/13932/1