up Inquisit Language Reference

sort function

Sorts the items in a list.

Member of

<list>

Syntax

element.name.sort(ascending, alphabetic)

or

element.name.sort(ascending, alphabetic)

Parameters

Name Type Description
ascending boolean Optional. True for ascending order, false for descending order.
alphabetic boolean Optional. True for alphabetic sorting, false for numeric sorting.

Examples

The following sorts a list alphabetically in ascending order:

<trial example>
/ ontrialend = [list.names.sort();]
</trial>

The following sorts a list numerically in ascending order:

<trial example>
/ ontrialend = [list.scores.sort(true, false);]
</trial>

The following sorts a list numerically in descending order:

<trial example>
/ ontrialend = [list.topscores.sort(false, false);]
</trial>

Send comments on this topic:
Copyright Millisecond Software, LLC. All rights reserved.