Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SEEK function with a TagName
Message
From
25/03/2004 06:19:36
 
 
To
24/03/2004 17:31:41
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00889314
Message ID:
00889530
Views:
20
Run this with attention, the problem is on related SET FILTER.
clear
* bug su index vfp6
SET SAFETY OFF
lc_sono   = '        67'
lc_item   = 'QAD3672        '
lc_loctid = 'WH1   '
ln_lineno = 1

CLOSE DATA ALL
SELECT 0
CREATE TABLE delme1 (custno C(10), sono C(10), lineno N(4,0))

*-- Add in a bunch of data
FOR ln_cntr = 65 TO 75
   FOR i = 1 TO 15
      INSERT INTO delme1 (custno, sono, lineno) ;
          VALUES (REPLICATE(CHR(ln_cntr), 4), PADL(ln_cntr, 10), i)
   ENDFOR
ENDFOR

*-- Create the index
INDEX ON sono + STR(lineno, 4) TAG sono1
INDEX ON custno + sono TAG custno1

SELECT 0
CREATE TABLE delme2 (item C(15), loctid C(6))
INSERT INTO delme2 (item, loctid) VALUES (lc_item, lc_loctid)
INSERT INTO delme2 (item, loctid) VALUES (lc_item, lc_loctid)

INDEX ON loctid + item TAG loctid1
INDEX ON item + loctid TAG item1

SELECT 0
CREATE TABLE delme4 (loctid C(6))
INSERT INTO delme4 (loctid) VALUES (m.lc_loctid)
INDEX ON loctid TAG loctid	&& FOR !DELETED()	&& WORKAROUND with a filtered index the bug is not present

* the bug source is THE FILTER ON the relation table, 
* and it occurs when the SEEK() into a another Table 
* do a Filter into a related table of the currer workarea !
* A little complex.

*SET FILTER TO NOT DELETED()		&& <=== this is the BUG SOURCE
SET FILTER TO filterEval(loctid)	&& a filter for debug the problem

*-- Set relations
SET RELATION TO loctid  INTO delme4 IN delme2 

* PUT ATTENTION, this bug is complex, because have a INTERNAL STATUS

* this not fire the bug !!!
? '-0-'
select 0
go 2 in delme2								&& this eval the filter
SEEK m.lc_item + m.lc_loctid in delme2		&& this eval the filter !!!!
SELECT delme2
? SEEK(m.lc_sono + STR(m.ln_lineno, 4), 'delme1', 'sono1') && returns .f.	&& this not eval the filter because SEEK have eval it before
? SEEK(lc_sono + STR(ln_lineno, 4), 'delme1', 'sono1') && returns .t.		&& this not eval the filter

* this fire the bug

select 0
go 2 in delme2				&& this eval the filter
SELECT delme2
SEEK m.lc_item + m.lc_loctid in delme2		&& this NOT eval the filter !!!!
? '-2-'
* CHOICE OF ONE OF NEXT LINES ************

? SEEK(m.lc_sono + STR(m.ln_lineno, 4), 'delme1', 'sono1') 							&& this eval the filter, AND HAVE THE BUG

* SEEK m.lc_sono + STR(m.ln_lineno, 4) IN delme1 ORDER sono1						&& this eval the filter BUT NOT HAVE THE BUG
* =lookup(delme1.custno,m.lc_sono + STR(m.ln_lineno, 4),delme1.custno,'sono1') 		&& this eval the filter BUT NOT HAVE THE BUG
*? INDEXSEEK(m.lc_sono + STR(m.ln_lineno, 4),.F., 'delme1', 'sono1') 				&& this not eval the filter, NEXT SEEK() HAVE THE BUG
*? INDEXSEEK(m.lc_sono + STR(m.ln_lineno, 4),.T., 'delme1', 'sono1') 				&& this not eval the filter, NEXT SEEK() HAVE THE BUG
*? KEYMATCH(m.lc_sono + STR(m.ln_lineno, 4),1,'delme1')								&& this not eval the filter, NEXT SEEK() HAVE THE BUG

* END CHOICE *****************************

? eof('delme1')
? SEEK(lc_sono + STR(ln_lineno, 4), 'delme1', 'sono1') 								&& this not eval the filter

procedure filterEval(prm)
	? m.prm,recno()
Fixed on VFP7SP1

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform