# o (sort values ascending) processing code

The o processing code sorts the values
in the specified attributes in ascending order. The values are sorted
when the item is filed.

While this can be used in the correlative attribute of
an attribute-defining item, it causes the screen to refresh with each
value added. To prevent this from occurring, it is advised that this
processing code be placed on the correlative attribute of the file-defining
item using the format listed below.

## First form: attribute-defining items

| System Processors | Update |
| --- | --- |
| Code Type | Attribute Defining |
| Dictionary Attributes | Input Conversion |

## Syntax

```
o
```
After a value is entered, the screen redisplays with the
value placed in ascending alphabetic (a-z) order.

The sort does *not* take place until a value is added to an attribute. If the
processing code is added to an existing attribute, the attribute can
be displayed and filed without the attribute getting sorted. If a
value is added, the attribute is sorted.

## Second form: file-defining items

| System Processors | Update |
| --- | --- |
| Code Type | File Defining |
| Dictionary Attributes | Input Conversion |

## Syntax

```
o{;}attribute.number{;attribute.number...}
```

## Parameter(s)

| attribute.number | Attribute to sort in ascending order. |
| --- | --- |
In file-defining items, the o processing
code may only be used in the correlative attribute. The first semicolon
is optional.

If you attempt to file or restore a sort values-ascending
(file-defining items) in an FSI file-defining item, it will be commented-out
with an asterisk (`*`).

This processing code
is supported only from the VME.

When the item is filed, the
value in the attributes specified by the attribute number is/are sorted
and replaced in ascending alphabetic (a-z) order. If an attribute
is not already sorted, adding this processing code sorts the attribute
the next time the item is filed.

## See also

- [Conversion](https://d3codex.com/definitions/conversion/)
- [Processing codes (Update processor)](https://d3codex.com/updateprocessor/processing-codes-update-processor/)
- [input-conversion](https://d3codex.com/attributedefiningitem/input-conversion/)
- [ms (mask alter sort) processing code](https://d3codex.com/processingcodes/ms-mask-alter-sort-processing-code/)
- [output-conversion](https://d3codex.com/attributedefiningitem/output-conversion/)
- [Processing codes overview](https://d3codex.com/processingcodes/processing-codes-overview/)
- [u1072 user exit](https://d3codex.com/pickbasic-flashbasic/u1072-user-exit/)

---
Source: https://d3codex.com/processingcodes/o-sort-values-ascending-processing-code/ - part of the D3Codex reference.
