This shows you the differences between two versions of the page.
| — |
guide:sip_syntax [2009/05/25 22:03] (current) 96.248.90.20 created |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | Special Inclusive Parenthetical syntax. | ||
| + | |||
| + | Some reporters that have a default fixed number of inputs, such as WORD and LIST, can be made to take more or less inputs by surrounding the entire expression with parenthesese. These parenthesese tell NetLogo to include the additional inputs, or to not eexpect more inputs when fewer inputs are provided. Some examples will help illustrate this. | ||
| + | |||
| + | The WORD reporter takes two inputs (of just about any value) and reports a single string containing those two values. This can be used to concatenate two strings, or to add a label to a value (such as PRINT WORD "Heading: " HEADING ). | ||
| + | |||
| + | But sometimes it is useful (such as when printing things to the output window or command center, to concatenate more items. | ||
| + | |||
| + | sometimes | ||
| + | |||
| + | |||
| + | That is, by surrounding the entire list expression with parentheses, one can create a list containing 0, 1, 2, or any other number of items. | ||