598
Chapter 13: Operators
-- (comment)
Usage
-- Lingo syntax
-- comment
// JavaScript 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.
Example
This handler uses a double hyphen to make the second, fourth, and sixth lines comments:
-- Lingo syntax
on resetColors
-- This handler resets the sprite’s colors.
sprite(1).forecolor = 35
-- bright red
sprite(1).backcolor = 36
-- light blue
end
// JavaScript syntax
function resetColors() {
// this handler resets the sprite’s colors
sprite(1).forecolor = 35;
// bright red
sprite(1).backcolor = 36;
// light blue
}
&, + (concatenation operator)
Usage
-- Lingo syntax
expression1
&
expression2
// JavaScript 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.
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.
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...