Next: Conditional Statements
// This is a comment.The interpreter ignores comment statements completely; they are for the benefit of human readers. Note that comments in
C-- are actual
statements, unlike comments in C, which are filtered out by the
preprocessor.
The expression statement evaluates an expression and discards its value. The syntax of the expression statement is:
expression;The following are expression statements:
3; sender().tell($sys.who());The assignment statement evaluates an expression and assigns the value to a variable. The syntax of the assignment statement is:
variable = expression;The interpreter assigns the value of expression to variable, which is a local variable if it has been declared as one, or an object variable on the current object if it has not been declared. See Variables.
The compound statement allows you to treat one or more statements as a single statement. The compound statement has the following syntax:
{
statement1
statement2
.
.
.
}
The interpreter executes each of statement1, statement2,
... in turn.
The return statement allows a method to stop exeuting statements
and to return a value other than the default return value of
this(). The return statement can have either of the following
two forms:
return expression; return;The interpreter stops executing statements in the method and returns the value of expression, or the dbref of the current object if expression is not given.