Xtras for Sale
Home (Spotlight) | TOC | Products & Ordering | Technical Info | Contact Zeus

Zingo Dictionary

Copyright © 1996-1997. Zeus Productions. All Rights Reserved.

Top A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

New Lingo

Undocumented Lingo

Non-alphabetical Operators

# (symbol operator)
[] (list operators)
-- (comment delimiter)
(continuation character)
@ (pathname operator)
( ) [parentheses]

& (string concatenation)
&& (string concatenation with space added)
" (quote used for string constant)

= (equal sign)
<> (not equal)
> (greater than)
>= (greater than or equal to)
< (less than)
<= (less than or equal to)

* (multiplication)
- (subtraction or negation)
+ (addition)
/ (division)

# (symbols and properties)

syntax: #symbolName

The number sign, or pound sign, (#) indicates a Lingo symbol, including symbols used as properties in a property list.

Symbols are a convenient for representing constants, such as integers and strings, and give you the speed and efficiency of integers, but are easier to understand and remember than "meaningless" integers.

	set fruit = #Apple  -- assignment

	if fruit = #Apple then put "Bite Me" -- comparison
	eat (#Apple)  -- Passing as a parameter

	-- Returned as a value from a function:
	on getFruit
		return #Apple

	-- Symbols use as properties in a property list
	set myPropList = [#Apples: 1, #Bananas:7, #Oranges: 8]

Symbols Names: Under Windows 3.1, the number of symbols is limited to 64K, or approximately 5,000 symbols depending on the length of each symbol and other global items.

Symbols are not the same as variables. you can not set a value for a symbol. (In this way they are different from C language #define statements)

See "Using Lists", property lists, global, symbolP, string

Refer to chapter 2 of the Lingo manual - Script basics

[] (list operator)

syntax: [element1, element2, ... elementn]

Lists are used to store multiple pieces of data. Brackets are used to create a list, such as:
	set myList = [1,7,8]
	set myPropList = [#Apples: 1, #Bananas:7, #Oranges: 8]
	set myEmptyList = []
	set myEmptyPropList = [:]	

If your keyboard does not have square brackets, you can use the list function instead.

See "Using Lists", property lists, list, listP, "Data Types"

-- (comment delimter)

syntax: -- Your comment here

The comment delimiter (two hypens in a row with no spaces) indicates that Lingo should ignore the following text. Use comments to explain your Lingo code.

Director also prints the comment character preceding any output in the Message window, such as:

put the colorDepth
-- 8

See continuation character

See Lingo programming structure definition
See TechNote, "Using Comments".

continuation character Mac/ Win

The continuation character joins long lines of Lingo together, and can be used to make your Lingo more readable.
if the memberNum of sprite 1 < the memberNum of 
sprite 2 then put "The test is true"

To create the continuation character, use:
Macintosh: Option-Return
Windown: Alt-Enter


The continuation character continues lines of comments too!
-- This is a long comment, even though
this line does not have a comment character
it is considered part of the previous line, and is therefor a comment

The Director manauls claim that a line is limited to 256 characters, but this is not the case.

& (string concatentation operator)

syntax: string1 & string 2

The concatenation operator (&) joins two strings, converting the second operand to a string if necessary.
	put "Hello" & "World"
	-- HelloWorld

Precedence level 2.

&& (string concatentation operators with added space)

syntax: string1 && string 2

The spaced concatenation operator (&&) joins two strings, converting the second operand to a string if necessary, and adding a space between them. Use this instead of manually padding a string with a space.
	put "Hello" && "World"
	-- Hello World

Precedence level 2.

() [parentheses]

syntax: (precedence grouping)
(expression1 + expression2) * expression3

syntax: function parameter call
handlerName(arg1, arg2, ...argn)

Parentheses are used for two distinct purposes:
For example:
	put 9 - 2 * 4

	put 9 - (2 * 4)

	put (9 - 2) * 4
	-- 28

	put ((9 - 1) / 4) * 5
	-- 10

Parentheses are required when Lingo does not not evaluate an expression in the order you would like, such as
open window the pathname & "myMovie" -- wrong

open window (the pathname & "myMovie") -- right

Parentheses are also used to surround the parameters being passed to a function call. They are optional if the function does not return a value, but are mandatory if the called function returns a value (even if there are no parameters).

on printText myString
put myString
return "hello"

put foo
-- <Void>

-- handler not defined error?

put foo ("Testing 1,2,3")
-- Testing 1,2,3
-- hello

foo "Testing 1,2,3"
-- Testing 1,2,3

foo("Testing 1,2,3")
-- "Testing 1,2,3"


Parentheses are required when calling a handler that returns a value. Otherwise Lingo thinks the handler name is just a variable, and an error results.

put rollover -- wrong (generates an error)

put rollover() -- right
-- 1

- (minus sign)

syntax (subtraction, precedence level 3):
set x = y - z

syntax (negation, precedence level 5):
set x = - y

See Arithmetic Operators for details on precedence and implicit type conversion.

* (multiplication)

set x = 5 * 4
put x
-- 20
Multiply every item in a list by some value

set newList = [1,2,3] * 5
put newList
-- [1,10,15]
Mutiplies two numbers. Precedence Level 4. If either operand is a floating point number, the result is a float, otherwise, the result is an integer

See Math Operators for Precedence and Type Conversion issues


+ See math operators


/ (division

expresstion 1 / expression 2

Integer divison - no rounding
floating point dvisions

Precede 4

put 10/3

-- 3

put 10/3.0
-- 3.333

See float precision


Comparsision operators

These perform implicit type conversions.

Can compare integers, floats, strings, rects and points.
<> and = also works with symbols and objects?




" (quote)

Defines a string constant such as

See Lingo expanation

Use Quote to include a quote in a string



@ pathname operators

- Avoid it - it is a hassle

Use the Linog separator instead - a lot of problems









Home (Spotlight) | Table of Contents | Links | Contact Info

Place an Order | Products for Sale | Licensing | Downloads

TechNotes | FAQs | E-Mail Zeus | GuestBook | Glossary

[End of Page]

Copyright © 1996-1997. Zeus Productions. All Rights Reserved.

(This page last revised August 25, 1997)