Exit from a function

stop

Terminates a function without returning any result.

Example:

to polygon :n [:x 50]
  :n := int :n
  if (:n < 3) || (:x <= 0) [print "error stop]
  repeat :n [fd :x rt 360 / :n]
  print "ok
end

polygon 2
polygon 5

Output:

error
ok

See also:

Function as a value
$, func - get function as a value

Table of Content