semicolon

 

The ; semicolon is used for making helpful comments or notes on a line of code. All the characters will turn grey after a semicolon is used. Keep in mind that whenever a semicolon is used at the beginning of the line, this part of the code will not run. We can also place comments to the right of a line of code. For example:

; the procedure below moves the fish forward
to move-fish 
 ask fish [ 
    right random 360 ; we make the fish turn randomly
    forward 1 
 ]  
end

In the model example below, we use ; semicolon to explain two lines of code and the wiggle procedure.

 

Try it Yourself

 
 
 
 
 
 
 

What's next?

Once you mastered the semicolon primitive, don't stop there. Check out the resources below to improve your NetLogo skills.

 
Published NetLogo models that use the semicolon primitive:
 
 
Similar primitives:
to

Begins a command procedure

Read more
to-report

Begin a procedure to create a custom reporter.

Read more
end

Concludes a procedure.

Read more
ask

Asks agents to do things.

Read more
 
Learn another primitive: