User Guide

544 Chapter 12: Methods
sort
Usage
list.sort()
sort list
Description
Command; puts list items into alphanumeric order.
When the list is a linear list, the list is sorted by values.
When the list is a property list, the list is sorted alphabetically by properties.
After a list is sorted, it maintains its sort order even when you add new variables using the
add command.
Parameters
None.
Example
The following statement puts the list Values, which consists of [#a: 1, #d: 2, #c: 3], into
alphanumeric order. The result appears below the statement.
put values
-- [#a: 1, #d: 2, #c: 3]
values.sort()
put values
--[#a: 1, #c: 3, #d: 2]
sound()
Usage
-- Lingo syntax
sound(intSoundChannel)
// JavaScript syntax
sound(intSoundChannel);
Description
Top level function; returns a reference to a specified sound channel.
The functionality of this method is identical to the Sound objects channel() method.
Parameters
intSoundChannel
Required. An integer that specifies the sound channel to reference.
Example
The following example assigns sound channel 1 to a variable music and plays a sound.
-- Lingo syntax
music = sound(1)
music.play(member("waltz1"))
// JavaScript syntax
var music = sound(1);
music.play(member("waltz1"));