User Guide

Lingo Dictionary 45
Examples
(Negation): This statement reverses the sign of the expression 2 + 3:
put -(2 + 3)
The result is -5.
(Subtraction)
: This statement subtracts the integer 2 from the integer 5 and displays the result in
the Message window:
put 5 - 2
The result is 3, which is an integer.
(Subtraction)
: This statement subtracts the floating-point number 1.5 from the floating-point
number 3.25 and displays the result in the Message window:
put 3.25 - 1.5
The result is 1.75, which is a floating-point number.
-- (comment)
Syntax
-- comment
Description
Comment delimiter; indicates the beginning of a script comment. On any line, anything that
appears between the comment delimiter (double hyphen) and the end-of-line return character is
interpreted as a comment rather than a Lingo statement.
The Director player for Java accepts Lingo that uses this delimiter, but comments do not appear
in the final Java code.
Example
This handler uses a double hyphen to make the second, fourth, and sixth lines comments:
on resetColors
-- This handler resets the sprite’s colors.
sprite(1).forecolor = 35
-- bright red
sprite(1).backcolor = 36
-- light blue
end
& (concatenator)
Syntax
expression1 & expression2
Description
String operator; performs a string concatenation of two expressions. If either expression1 or
expression2 is a number, it is first converted to a string. The resulting expression is a string.
This is a string operator with a precedence level of 2.
Be aware that Lingo allows you to use some commands and functions that take only one argument
without parentheses surrounding the argument. When an argument phrase includes an operator,
Lingo interprets only the first argument as part of the function, which may confuse Lingo.