Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GOTO on Filtered data
Message
From
18/11/2004 07:35:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00962533
Message ID:
00962542
Views:
9
Hi Sergey and thanks for the reply.

Yes I know that set filt doesn't move the file pointer - that's why I do Go Top. I usually do LOCATE (I'm an advocate of doing this) but I changed it to Go Top, in case that was what was causing the problem (as I don't have any indexes on the table), just before posting.

Your solution would seem sound but
1) I still don't know why I'm getting this mythical extra rec no (and with me it's like "I gots to know" :-)).
2) In this very case, I'd have to issue:
If lnRecNo > 0
    Goto lnRecNo
Endif
which means, in the "all hidden" case I still wouldn't be able to get back to my current record when I toggle back to show.

Cheers

Terry

>Hi Terry,
>
>I would adjust code as follow
  Select pxEntryCodes
>  IF BETWEEN(RECNO(), 1, RECCOUNT())
>      lnRecNo  = RECNO()
>  ENDIF
>
>  If .lHide
>      Set Filter To EMPTY( FacCatCode)  && i.e. hide all those that have a value
>  Else
>      Set Filter To
>  Endif
>  ***Go Top
>  LOCATE   && It's Rushmore optimizable and GO is not
>           && wouldn't make difference on small record set, though
BTW, SET FILTER by itself doesn't move record pointer even when current record doesn't satisfy the filter conditions.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform