Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: SET NEAR and integer seek
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
BUG: SET NEAR and integer seek
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01021240
Message ID:
01021240
Views:
110
Run this
CLEAR

CREATE CURSOR test (XX I)
INSERT INTO test VALUES ( 1 )
INSERT INTO test VALUES ( 2 )
INSERT INTO test VALUES ( 3 )

INDEX ON XX TAG ttag
SET ORDER TO
SET NEAR ON
? "LOW BOUND : Expected : RECNO()=1, XX=1"
FOR K=-5 TO 5
	* set a random position
	GO 1+RECCOUNT()*RAND()
	* seek a big number
	SEEK -2147483647+m.K ORDER 1
	
	IF m.k=-1
		? "look this value, this is a VFP's out of range integer ( but a good C++ integer ), and VFP return correct near value"
	ENDIF
	? "VALUE =",-2147483647+m.K,"RECNO()=",RECNO(),"FIELD XX=",XX

NEXT
? "HIGHT BOUND : Expected : RECNO()=3, XX=3"
FOR K=-5 TO 5
	* set a random position
	GO 1+RECCOUNT()*RAND()
	* seek a big number
	SEEK 2147483647+m.K ORDER 1 DESCENDING 

	? "VALUE =",2147483647+m.K,"RECNO()=",RECNO(),"FIELD XX=",XX
NEXT
Next
Reply
Map
View

Click here to load this message in the networking platform