Sort

concerns

The Sort attribute function sorts a list ascending or descending. For sorting of object lists better use the SortIndirect attribute function.

 

Syntax

Sort(SType)

Return value

None

Parameter

Use

Name

Type

Passing

Description

Required

SType

SortType

ByVal

The sort direction

 

SortType

Description

0 – Ascending

The list will be sorted ascending.

1 – Descending

The list will be sorted descending.

 

Example:

 

Colors.Add({"red", "blue", "green"})

Colors.Sort(0)

 

MsgBox(Colors.Join)

#shows blue,green,red

 

Colors.Sort(1)

 

MsgBox(Colors.Join)

#shows red,green,blue