Data Types
StarLogo supports only a few data types: Booleans, Lists, Numbers, and Strings.
There are two booleans, true
and false
. There are no numeric equivalents to true and false (such as 1 or 0). They must be referred to by name (or by executing a logical operator (=, not=, <, >, <=, >=
).
A [list of data]
is a data list, similar to a list in other versions of
Logo. Unlike other Logo languages, however, StarLogo does not enable you to
execute a list of data as an instruction (that is, there is no run
command). You can create a list of data using the list or sentence
commands, or by enclosing the literal elements in []
's. (e.g. setfamily
[my mother is nice]). You can create an empty list using []
. No elements
inside the []
's are evaluated.
Note: In this version of StarLogo turtles, patches, and the observer can
access a list of data.
In StarLogo, numbers have a range that is determined by the version of Java
that you are using. In Sun's Java this ranges from approximately -1*10^300
to 1*10^300, and decimals can go down to about 1*10^-300. Values smaller
than 1*10^-300 return a value of 0, and values larger than 1*10^300 return a
value of "Infinity".
Strings are used to refer to filenames and other strings. Strings are
written as a string with a quotation mark " at the beginning and the end
(e.g. "foo"
or "myfile.txt"
).
If you would like more information about how to declare variables, visit the variables page.