Writing Scripts with Lingo
409
Note:
When only integers are used in an operation, the result is an integer. Using integers and floating-point
numbers in the same calculation results in a floating-point number.
When dividing one integer by another doesn’t result in a whole number, Lingo rounds the result
down to the nearest integer. For example, the result of
4/3
is
1
.
To force Lingo to calculate a value without rounding the result, use
float()
on one or more
values in an expression. For example, the result of
4/float(3)
is 1.333.
Comparison operators
Comparison operators compare two values and determine whether the comparison is true or false.
These are the comparison operators available in Lingo:
Logical operators
Logical operators test whether two logical expressions are true or false. These are the logical
operators available in Lingo:
The
not
operator is useful for toggling a
TRUE
or
FALSE
value to its opposite. For example,
the following statement turns on the sound if it’s currently off and turns off the sound if it’s
currently on:
set the soundEnabled = not (the soundEnabled)
+
Performs addition.
3
-
When placed between two numbers, performs subtraction.
3
Operator
Meaning
Precedence
<
Is less than
1
<=
Is less than or equal to
1
<>
Is not equal to
1
>
Is greater than
1
>=
Is greater than or equal to
1
=
Equals
1
Operator
Effect
Precedence
and
Determines whether both expressions are true.
4
or
Determines whether either or both expressions are true.
4
not
Negates an expression.
5
Operator
Effect
Precedence
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...