Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INDEXSEEK Bug?
Message
From
09/05/2002 07:57:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
INDEXSEEK Bug?
Miscellaneous
Thread ID:
00654373
Message ID:
00654373
Views:
53
Could somebody explain the results of the following code:
CREATE DATABASE temp
CREATE TABLE anytable (pkey I PRIMARY KEY)
SET MULTILOCKS ON 
CURSORSETPROP('Buffering',5)

FOR n = 1 TO 10
   INSERT INTO anytable (pkey) VALUES (n)
	
   IF !INDEXSEEK(n,.F.,'anytable','pkey')	&& same result with .T. or .F. in move record pointer parameter
      WAIT TRANSFORM(n) WINDOW	&& no record found ???? Why not?
   ENDIF
ENDFOR

WAIT 'Now try KEYMATCH' WINDOW

FOR n = 11 TO 20
   INSERT INTO anytable (pkey) VALUES (n)
	
   IF !KEYMATCH(n,TAGNO('pkey'),'anytable')
      WAIT TRANSFORM(n) WINDOW	&& never executed, because KEYMATCH works fine
   ENDIF
ENDFOR

WAIT 'Now try SEEK' WINDOW

FOR n = 21 TO 30
   INSERT INTO anytable (pkey) VALUES (n)
	
   IF !SEEK(n,'anytable','pkey')
      WAIT TRANSFORM(n) window	&& never executed, because SEEK also works as advertised
   ENDIF
ENDFOR

=TABLEREVERT()
USE IN anytable
CLOSE DATABASES all

ERASE anytable.dbf
ERASE anytable.cdx

ERASE temp.dbc
ERASE temp.dct
ERASE temp.dcx
So INDEXSEEK doesn't work on buffered tables? Doesn't say that in the documentation anywhere that I can find. Makes the function more or less useless, doesn't it?
Ray Roper
Next
Reply
Map
View

Click here to load this message in the networking platform