#### Description:

This attribute determines the order in which keys are returned by the astMapKey function. It may take the following values (the default is `"` None`"` ):

- `"` None`"` : The keys are returned in an arbitrary order. This is the fastest method as it avoids the need for a sorted list of keys to be maintained and used.

- `"` AgeDown`"` : The keys are returned in the order in which values were stored in the KeyMap, with the key for the most recent value being returned last. If the value of an existing entry is changed, it goes to the end of the list.

- `"` AgeUp`"` : The keys are returned in the order in which values were stored in the KeyMap, with the key for the most recent value being returned first. If the value of an existing entry is changed, it goes to the top of the list.

- `"` KeyAgeDown`"` : The keys are returned in the order in which they were originally stored in the KeyMap, with the most recent key being returned last. If the value of an existing entry is changed, its position in the list does not change.

- `"` KeyAgeUp`"` : The keys are returned in the order in which they were originally stored in the KeyMap, with the most recent key being returned first. If the value of an existing entry is changed, its position in the list does not change.

- `"` KeyDown`"` : The keys are returned in alphabetical order, with `"` A...`"` being returned last.

- `"` KeyUp`"` : The keys are returned in alphabetical order, with `"` A...`"` being returned first.

Type:

  String.

#### Applicability

##### KeyMap

All KeyMaps have this attribute.

#### Notes:

- If a new value is assigned to SortBy (or if SortBy is cleared), all entries currently in the KeyMap are re-sorted according to the new SortBy value.

Copyright (C) 2021 East Asian Observatory