CT_CHARMIRR

 CHARMIRR()
 Mirrors characters within a string

 Syntax

     CHARMIRR(<cString>,[<lBlank>]) --> cString

 Arguments

     <cString>  [@]  Designates the character string that is mirrored.

     <lBlank>  Designates whether the function mirrors everything (.F.)
     or does not mirror the blanks at the end of a character string (.T.).
     The default value is .F..

 Returns

     CHARMIRR() returns the processed <cString>.

 Description

     CHARMIRR() reverses a string.  The function returns a palindrome of
     <cString>.

     The optional logical parameter allows you to mirror a string and ignore
     the blanks.  This permits you to build index entries that end with a
     particular sequence.

 Note

     .  The returned value of this function can be suppressed by
        implementing CSETREF() to save room in working memory.

 Examples

     .  This example shows a simple exchange:

        ? CHARMIRR("abc321")         // Result: "123cba"

     .  This example shows one of the best known palindromes:

        ? CHARMIRR("ABLE WAS I ERE I SAW ELBA")

     .  When you index, you must do it without spaces because this is
        the only way a reverse string can be searched for:

        INDEX ON CHARMIRR(Field, .T.) TO Index

     .  Search for all expressions in the mirrored index, ending in
        "per":

        SEEK "rep"

See Also: CSETREF() Introduction

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.