MOO has several different types of value.
"this is a string"
To include a " character inside a string, you need to put a '\' character before it. Eg: "Bob says, \"Hello.\" and smiles."
Also, to include a backslash in a string, you need to put another backslash before it - "this is a backslash: \\"
would look like this is a backslash: \
1
or -26
. The largest number that MOO can handle is 2147483647. If you add 1 to it, it wraps around and becomes -2147483647.
1.001
, 0.0
or -36.4
$thing
or $surface
. These are generally, but not exclusively, the objects that are used for parents of new ones. They're stored on the system object - #0 - in properties. So the property #0.thing
will contain the object number of the generic thing. Try and have a look at all the properties on #0 that contain objects - these are all the neat parent objects that people have made up till now.
{"a string", 1, #2}
{5, {"string inside a list inside a list"}}
{}
- just as easily as they can contain other values.
To extract a particular item from inside a list is quite easy if you know whereabouts it is. To do this, you put square brackets after the list with the index of the item in it. For example, if you wanted the first item in the list, you would put [1]
after it. To use our first example above, {"a string", 1, #2}[1]
would be the same as "a string"
.
Note, oh C and Perl programmers, that the first element in the list is indexed with the number 1, not 0! Putting [0]
after a list will raise an E_RANGE
error. For this, see below.
E_
with some more capital letters after them. The list of errors and their meanings is given in the Programmer's Manual, but the most common ones are: