Chapter 3
46
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")
The parentheses clear up Lingo’s confusion by changing the precedence by which Lingo deals with
the operator, causing Lingo to treat the two parts of the argument as one complete argument.
Examples
This statement concatenates the strings “abra” and “cadabra” and displays the resulting string in
the Message window:
put "abra" & "cadabra"
The result is the string “abracadabra”.
This statement concatenates the strings “$” and the content of the
price
variable and then
assigns the concatenated string to the Price field cast member:
member("Price").text = "$" & price
&& (concatenator)
Syntax
expression1
&&
expression2
Description
String operator; concatenates two expressions, inserting a space character between the original
string 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.
Examples
This statement concatenates the strings “abra” and “cadabra” and inserts a space between the two:
put "abra" && "cadabra"
The result is the string “abra cadabra”.
This statement concatenates the strings “Today is” and today’s date in the long format and inserts
a space between the two:
put "Today is" && the long date
If today’s date is Tuesday, July 30, 2000, the result is the string “Today is Tuesday, July 30, 2000”.
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...