SET EXACT Command Determines String Comparison Method

Last reviewed: April 17, 1995
Article ID: Q89673
The information in this article applies to:
  • Microsoft FoxBASE+ for MS-DOS, version 2.1
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a

The SET EXACT command specifies the method used to compare strings.

When EXACT is on, the compared strings must be the same length and contain the same characters in order to be considered equal. Using the == relational operator gives the same results as SET EXACT ON.

If EXACT is set to OFF and one string contains a prefix of the other string, the strings are considered equal. The two strings are compared until the string on the right side of the expression is exhausted. If the compared characters match, the strings are considered equal.

For example, SET EXACT ON gives the following string comparisons:

    'randy' = 'ran'     .F.
    'ran' = 'randy'     .F.

SET EXACT OFF gives the following string comparisons:

    'randy' = 'ran'     .T.
    'ran' = 'randy'     .F.


Additional reference words: FoxDos 2.00 2.10 2.50 2.50a
KBCategory: kbusage kbprg
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.