Article ID: 165068
Article Last Modified on 2/4/2000
-or-
If you attempt to build an index with a key that varies in length, the key will be padded with spaces. Variable-length index keys aren't supported in Visual FoxPro.
SET TALK OFF && If TALK isn't turned off, an error will occur.
SET SAFETY OFF
CREATE TABLE oneproduct ;
(PRODUCT c(15))
SET SAFETY ON
INSERT INTO oneproduct (PRODUCT) VALUES ("01PAN AG-1310")
INDEX ON PADR(SUBSTR(product, AT(" ", product)+1), ;
LEN(product)+2 ," ") TAG prod
SET SAFETY OFF
CREATE TABLE oneproduct ;
(PRODUCT c(15))
SET SAFETY ON
INSERT INTO oneproduct (PRODUCT) VALUES ("01PAN AG-1310")
* The following code works without error in versions prior to 5.0
INDEX ON SUBSTR(PRODUCT,AT(" ",PRODUCT)+1) TAG prod1
INDEX ON RIGHT(PRODUCT,LEN(PRODUCT)-AT(" ",PRODUCT)) TAG prod2
* The following code works without error:
*!* SET TALK OFF
*!* INDEX ON PADR(SUBSTR(product, AT(" ", product)+1), ;
*!* LEN(product)+2 ," ") TAG prod
The first INDEX ON line causes the error message,
The second INDEX ON line causes the error message,
This behavior does not occur in earlier versions of FoxPro and the indexes
are created without error.
Additional query words: previous kbvfp500
Keywords: kbprb KB165068