User Guide
156 Chapter 9: Constants
RETURN (constant)
Usage
-- Lingo syntax
RETURN
// JavaScript syntax
36 // value of _key.keyCode
\n // when used in a string
Description
Constant; represents a carriage return.
Example
This statement causes a paused movie to continue when the user presses the carriage return:
-- Lingo syntax
if (_key.key = RETURN) then _movie.go(_movie.frame + 1)
// JavaScript syntax
if (_key.keyCode == 36) {
_movie.go(_movie.frame + 1);
}
This statement uses the RETURN character constant to insert a carriage return between two lines in
an alert message:
-- Lingo syntax
_player.alert("Last line in the file." & RETURN & "Click OK to exit.")
// JavaScript syntax
_player.alert("Last line in the file.\nClick OK to exit");
In Windows, it is standard practice to place an additional line-feed character at the end of
each line. This statement creates a two-character string named CRLF that provides the
additional line feed:
CRLF = RETURN & numToChar(10)
SPACE
Usage
-- Lingo syntax
SPACE
// JavaScript syntax
49 // value of _key.keyCode
Description
Constant; read-only, value that represents the space character.
Example
This statement displays “Age Of Aquarius” in the Message window:
-- Lingo syntax
put("Age"&SPACE&"Of"&SPACE&"Aquarius")