How do I stop an Arduino sketch?

Could you direct me to a sketch that doesn't use a loop but rather moved the servo to a specified degree? I am unable to find any such code. Or can you tell me how to modify the example sweep code to stop the loop. I am remoting into my pc from work and controlling a webcam attached to the top of the servo from across the net. This is why I don't want it to continually move.