Lingo Dictionary
47
() (parentheses)
Syntax
(
expression
)
Description
Grouping operator; performs a grouping operation on an expression to control the order of
execution of the operators in an expression. This operator overrides the automatic precedence
order so that the expression within the parentheses is evaluated first. When parentheses are nested,
the contents of the inner parentheses are evaluated before the contents of the outer ones.
This is a grouping operator with a precedence level of 5.
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.
For example, the
open window
command allows one argument that specifies which window to
open. If you use the
&
operator to define a pathname and filename, Director interprets only the
string before the
&
operator as the filename. For example, Lingo interprets the statement
open
window the applicationPath & "theMovie"
as
(open window the applicationPath) &
("theMovie")
. Avoid this problem by placing parentheses around the entire phrase that includes
an operator, as follows:
open window (the applicationPath & "theMovie")
Example
These statements use the grouping operator to change the order in which operations occur (the
result appears below each statement):
put (2 + 3) * (4 + 5)
-- 45
put 2 + (3 * (4 + 5))
-- 29
put 2 + 3 * 4 + 5
-- 19
* (multiplication)
Syntax
expression1
*
expression2
Description
Math operator; performs an arithmetic multiplication on two numerical expressions. If both
expressions are integers, the product is an integer. If either or both expressions are floating-point
numbers, the product is a floating-point number.
This is an arithmetic operator with a precedence level of 4.
Examples
This statement multiplies the integers 2 and 3 and displays the result in the Message window:
put 2 * 3
The result is 6, which is an integer.
Summary of Contents for DIRECTOR MX-LINGO DICTIONARY
Page 1: ...Lingo Dictionary Macromedia Director MX...
Page 756: ...Index 756...