[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 STRSWAP()
 Interchanges two strings
------------------------------------------------------------------------------
 Syntax

     STRSWAP(<cString1>,<cString2>) --> cString

 Arguments

     <cString1>  [@] and <cString2>  [@]  Designate the two strings
     that are interchanged.  At least one of the character strings must be
     passed by reference.

 Returns

     STRSWAP() always returns a null string.  This function only affects
     strings that have been passed by reference.

 Description

     STRSWAP() interchanges the strings <cString1> and <cString2>.  The
     exchange continues until all the characters in the shorter character
     string have been moved.  The function terminates when the last character
     of the shortest string is exchanged.

 Note

     .  The character strings are changed directly.  Therefore, at
        least one of the strings must have been passed by reference to get a
        result.

 Examples

     .  In this example, two strings are passed by reference:

        cStr1  :=  "1234567890"
        cStr2  :=  "ABCDEFGHIJKLM"
        ? STRSWAP(@cStr1, @cStr2)      // Return value: ""

     .  The two strings subsequently contain these characters:

        ? cStr1                        // "ABCDEFGHIJ"
        ? cStr2                        // "1234567890KLM"

     .  In this example, only one of the strings is passed by
        reference:

        cStr1  :=  "1234567890"
        cStr2  :=  "ABCDEFGHIJKLM"
        ? STRSWAP(cStr1, @cStr2)       // Return value: ""

     .  Both strings subsequently contain the characters of the string
        passed by reference:

        ? cStr1                        // "1234567890"
        ? cStr2                        // "1234567890KLM"


See Also: Introduction
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson