How to Use a UDF in Index with the Trim Functions (129889)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft FoxPro for MS-DOS 2.0
- Microsoft FoxPro for Macintosh 2.6a
- Microsoft FoxPro for UNIX 2.6
This article was previously published under Q129889 SUMMARY
When creating an index key, it is important to remember that the index keys
will have a fixed length even if the length of the field contents are
varying lengths. FoxPro does not create or use variable-length keys. Index
keys are padded with spaces to a constant size (the length of the field in
the table structure).
You can use a User-Defined Function (UDF) in an index expression. For
example, you can order the records based on a partial field (for example,
the street name in an address field). When a UDF is used to create an index
key, the UDF is called twice to initiate the process before the records are
processed. Then it is called once for each record in the table.
This article shows by example how to use a UDF in an index expression with
the four trim functions.
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | kbcode KB129889 |
---|
|