FOR() Function Returns Index Info in Uppercase LettersLast reviewed: November 21, 1995Article ID: Q120791 |
The information in this article applies to:
SUMMARYThe FOR() function in FoxPro version 2.6 returns the index information in uppercase letters only. The FOR() function was added in the version 2.6 series for compatibility with dBASE. In dBASE, the information returned is in uppercase, lowercase, or a combination of both; it depends on how the text was typed originally when the index was created by using a FOR clause in the INDEX command.
MORE INFORMATIONHere's an example showing how the FOR clause and the FOR() function work. If the index was created by typing the following command in the command window on a database that has a field called name:
INDEX ON name FOR name = 'Smith' TAG namsmiththis index will show only those records that have the word "Smith" in the name field. If you type "? for()" (without the quotation marks) in the command window, FoxPro will display the FOR clause that was used in the INDEX expression. The expression will be in all uppercase letters (NAME="SMITH"). If a FOR clause was not used on the index, the FOR() function returns a null string value. This could cause a problem in cases where code written in dBASE recreates an index based on the condition of the FOR() function. To work around this, you can change the code to:
INDEX ON name FOR UPPER(name) = 'SMITH' TAG namsmithThe index would be then index on the uppercase of the word 'Smith'. Using a command such as SEEK would still look for the word 'Smith' and not for 'SMITH'. |
Additional reference words: FoxDos FoxWin 2.60 2.60a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |