### run
runresult

#### run command-task
run string
runresult reporter-task
runresult string

The `run` form expects a command task or a string containing commands. This agent then runs them.

The `runresult` form expects a reporter task or a string containing a reporter. This agent runs it and reports the result.

Note that you can't use `run` to define or redefine procedures. If you care about performance, note that the code must be compiled first which takes time. However, compiled bits of code are cached by NetLogo and thus using `run` on the same string over and over is much faster than running different strings. The first run, though, will be may be many times slower than running the same code directly, or in a command task.

Tasks are recommended over strings whenever possible. (An example of when you must use strings is if you accept pieces of code from the user of your model.)

Tasks may freely read and/or set local variables and procedure inputs. Trying to do the same with strings may or may not work and should not be relied on.

Take me to the full NetLogo Dictionary