This agent exits immediately from the enclosing procedure, ask, or ask-like construct (e.g. crt, hatch, sprout). Only the current procedure stops, not all execution for the agent.
if not any? turtles [ stop ] ;; exits if there are no more turtles
Note: stop can be used to stop a forever button. If the forever button directly calls a procedure, then when that procedure stops, the button stops. (In a turtle or patch forever button, the button won't stop until every turtle or patch stops -- a single turtle or patch doesn't have the power to stop the whole button.)
It can also be used to stop a BehaviorSpace model run. If the go commands directly call a procedure, then when that procedure stops, the run ends.
Take me to the full NetLogo Dictionary