up Inquisit Language Reference

sort function

Sorts the items in a list.

Member of

<list>

Syntax

list.name.sort(ascending, alphabetic)

Return Type

none

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.

Remarks

This function sorts the items in a list. By default, items are sorted according to alphabetically in ascending order. Optional parameters can be specified to sort numerically and by descending order.

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>

Copyright Millisecond Software, LLC. All rights reserved.