Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>charsort()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CHARSORT()

Syntax:     CHARSORT([@]<expC>[,<expN1>][,<expN2>][,<expN3>][,<expN4])

Arguments:  <expC> is the string to be sorted.
            <expN1> determines the length of the sorting element
            (default: 1 character).
            <expN2> denotes the number of characters of a sorting
            element to be considered in a comparison (default: <expN1>
            characters).
            <expN3> corresponds to an offset which indicates the
            position from which the sorting should start in <expC>
            (default: 0).
            <expN4] also denotes an offset.  This is used to determine
            the position within the sorting element, stipulated by
            <expN1>, where the comparison should be made (default: 0).

Returns:    A character string.
            The sorted <expC> string.

Usage:      CHARSORT() can be used to sort the characters in a string
            in several different ways.

Notes:      Invalid arguments will result in a null string.  The function
            uses a quick sort algorithm.

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   * Normal sorting of characters in a
            * string, in accordance with there ASCII code.
            ? CHARSORT("qwert")                         && "eqrtw"

            * Sort elements 2 bytes long.
            ? CHARSORT("qwert",2)                       && "erqwt"

            * Sort elements 2 bytes long.  However,
            * only its first character is to be used
            * in the comparison.
            ? CHARSORT("bla4a3a2a1",2,1)                && "a2a1a3a4b1"

            * Individual characters are sorted, from which
            * the first three characters are exempted.
            ? CHARSORT("123qwert",1,1,3)                && "123eqrtw"

            * Pairs of elements are sorted for the whole
            * string, where only the second character within
            * the element will be used in the comparison.
            ? CHARSORT("b1a4a3a2a1",2,1,0,1)            && "a1b1a2a3a4"



Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson