Syntax
When Lingo was created, a verbose syntax was designed to mimic spoken language, so it would be easy for beginners to get started. You could write whole HyperTalk-like sentences such as:
if sprite 5 is visible then go to the frame
Note that in "go to" statements the "to" is optional. Also note that unlike other programming languages, "go" statements reference frames in Director's Score, not particular lines of code.
Lingo was also initially very robust by providing object generation through a notion called factory
, which led to the language's extensibility through External Factories (XFactories) or XObjects.
Although it is still possible to use the verbose syntax, the current version of the language fully supports dot syntax, so that the code looks more like standard programming languages such as JavaScript or C++.
The equivalent in new scripting style would be:
if sprite(5).visible then _movie.go(_movie.frame)
This format uses elements of the Director Object Model, introduced in Director MX 2004. The syntax in prior versions would be like:
if sprite(5).visible then go the frame
8877165145
Read more about this topic: Lingo (programming Language)