Chapter 5. Data Types and Expressions

This chapter covers data types, expression evaluation, and operators. Refer to Chapter 1, for a discussion of variables, and to Chapter 8, for details on numeric data types. Refer to Chapter 7, for details on string manipulation and to Chapter 6, for many details on lists. See also Chapter 19, for a detailed discussion of symbols.

Data Types and Variable Types

In addition to Lingo keywords, Lingo uses constants, variables, symbols, and literals, which can contain various data types such as integers, floats, and strings.

Constants

Constants are common values, such as PI, FALSE, and TRUE, that are predefined in Lingo for convenience.

Literals

Literals are fixed values specified by the programmer, such as 6 (an integer literal), and “flubber” (a string literal).

Symbols

Symbols are a convenient way to represent strings or integers. Lingo includes some symbols, such as #digitalVideo, and the programmer can define others.

Variables

Variables contain data that can change. A variable, such as myHighScore, may equal 5 at one point but later be updated so that it equals 7.

Lingo data types, summarized in Table 5-1, include those common to most languages, as well as objects and other complex types that are unique to Lingo. Note that there is no double-precision float type or short integer type. Lists are roughly equivalent to arrays and structures. Refer to Chapter 1 and Chapter 6 for a discussion of variables and lists, and refer to Chapter 4, and the downloadable ...

Get Lingo in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.