Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>strswap()</b> http://www.X-Hacker.org [<<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

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