SETLOGICALORDER

Use this function to convert a bidirectional data object from visually ordered (characters ordered as they are presented for reading) to logically ordered (the order in which text is typed on a keyboard or phonetic order).

This function is only for use with text objects that have bidirectional properties. The function will have no affect on objects that have no bidirectional properties.

Syntax:
SETLOGICALORDER (single-text-expression , single-text-expression)
Meaning:
SETLOGICALORDER (visually_ordered_text_object , TRUE_or_FALSE_text_object)
Returns:
A logically ordered text object.

The SETLOGICALORDER function changes the order of the data as held in memory (order scheme) of a text object that is being passed as a parameter. The function returns a text object that reflects the order scheme change.

The output of the function will be the data from the original bidirectional item, transformed to match the specified layout (as it would be if it were assigned to a bidirectional item with the specified characteristics). This allows you to use text manipulation functions, such as LEFT or MID, on bidirectional data using the proper understanding of the bidirectional data. For example, LEFT of the logical ordering of a bidirectional item would actually take the rightmost characters of the visual ordering of that item.

Example

The properties of the text objects define the orientation and memory order of data objects found in the data stream.

Text objects defined as right-to-left would be considered as starting from the right character and progressing to the left, until the end of the data. However, the data can be held in memory with the start character (the right most character) being held in the left most position. This memory ordering is defined by the ordering scheme of the object.