String operators
String operators combine and define strings. These are the string operators available in Lingo:
Operator
Effect
&
Concatenates two strings.
&&
Concatenates two strings and inserts a space between the
two.
"
Marks the beginning or end of a string.
Controlling flow in scripts
Lingo uses
if...then...else
whether a condition exists. See the following sections.
Using if statements
Statements that check whether a condition is true or false begin with the Lingo term
condition exists, Lingo executes the statement that follows
Lingo skips to the next statement in the handler.
To optimize your script's performance, test for the most likely conditions first.
The following statements test several conditions. The term
perform if previous conditions are false:
if the mouseMember = memberNum("map 1") then
go to "Cairo"
else if the mouseMember = member ("map 2") then
go to "Nairobi"
else
alert "You're lost."
end if
When writing
if...then
, or you can place it on its own line by inserting a carriage return after
then
carriage return, you must also include an
For example, the following statements are equivalent:
if the mouseMember = member("map 1") then go to "Cairo"
if the mouseMember = member("map 1") then
go to "Cairo"
end if
For more information, see
Using case statements
The
statement is a shorthand alternative to repeating
case
multiple branching structure. A
large number of
if...then...else
The condition to test for follows the term
comparison goes through each line in order until Lingo encounters an expression that matches
the test condition. When a matching expression is found, Director executes the Lingo that follows
the matching expression.
410
Chapter 16
,
, and
case
repeat
structures, you can place the statement following
end if
in the Lingo Dictionary.
if
statement is often more efficient and easier to read than a
case
statements.
case
Precedence
2
2
1
statements to perform an action depending on
. If the condition doesn't exist,
then
specifies alternative tests to
else if
statement at the end of the
statements when setting up a
if...then
in the first line of the
case
If the
if.
in the same line as
then
. If you insert a
then
structure.
if...then
structure. The
Need help?
Do you have a question about the DIRECTOR MX-USING DIRECTOR MX and is the answer not in the manual?