Using Director > Writing Scripts with Lingo > Expressing literal values > Writing strings

 

Writing strings

Strings are characters that Lingo treats as characters instead of as variables. Strings must be enclosed in double quotation marks. For example, in the statement

member ("Greeting").text = "Hello"

"Hello" and "Greeting" are both strings. "Hello" is the literal text being put into a text cast member; "Greeting" is the name of the cast member.

Similarly, if you test a string, double quotation marks must surround each string, as in the following example:

if "Hello Mr. Jones" contains "Hello" then soundHandler

Lingo treats spaces at the beginning or end of a string as a literal part of the string. The following expression includes a space after the word to:

put "My thoughts amount to "

Although Lingo does not distinguish between uppercase and lowercase when referring to cast members, variables, and so on, literal strings are case sensitive. For example, the following two statements place different text into the specified cast member, because "Hello" and "HELLO" are literal strings.

member ("Greeting").text = "Hello"
member ("Greeting").text = "HELLO"