Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with index
Message
From
08/11/2002 03:27:16
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Problem with index
Miscellaneous
Thread ID:
00720158
Message ID:
00720158
Views:
55
Hi everyone,

we have a strange problem with index and compatibility between VFP and FPD.
Conditions:
FoxPro 26.6/DOS, code page 852
VFP 7.0/SP2, code page 1250

The problem is with indexes with clause FOR. When index is created in FPD, SEEK is working correctly. Then I open same table in VFP and change index (reindex or delete and append new record). Finally open table in FPD and SEEK working incorrect.

Here is code to reproduce problem:
CLEAR
SET SAFETY OFF
SET NEAR ON
SET EXACT OFF
IF !FILE("TEST.DBF")
  CREATE TABLE ("TEST.DBF") (name C(4), id1 C(1), id2 C(1), Valid L)
  INSERT INTO (DBF()) VALUES ("Adam","X"," ",.F.)
  INSERT INTO (DBF()) VALUES ("Dave","X"," ",.F.)
  INSERT INTO (DBF()) VALUES ("Mark","X"," ",.T.)
  INSERT INTO (DBF()) VALUES ("John","X"," ",.F.)
  INDEX ON name+id1+id2 TAG name FOR !VALID
  USE
ENDIF

USE ("TEST.DBF") ORDER name EXCL
#IF "WINDOWS" $ UPPER(VERSION())
  INDEX ON name+id1+id2 TAG name FOR !VALID
#ENDIF

? SEEK("DaveX ")
? SEEK("DaveX")
USE
Step by step to reproduce problem:
1. Run this code in FPD.
2. Both SEEK return .T.
3. Start VFP and run same code in same directory again.
4. Both SEEK return .T.
5. Start FPD and run same code
6. First SEEK return F. and second .T.

When you modify code and change index - without clause FOR
INDEX ON name+id1+id2 TAG name && FOR !VALID
everything is o.k.

I thing, the problem is in clause FOR.

Do you know any solution ?

MarianL
Next
Reply
Map
View

Click here to load this message in the networking platform