Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set FILTERS and GO rec problem?
Message
 
 
To
02/12/2001 17:35:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00585621
Message ID:
00588544
Views:
31
I didn't expect it eaither.
Bad, bad foxpro. :)

>LOCATE RECORD x
>will always take you to record x regardless of the filter setting. I wouldn't have expected that.
>
>
>
>>Try
lnRecNo = RECNO()
>>SET FILTER TO < whatever >
>>*-- attempt to restore the pointer
>><B>LOCATE RECORD lnRecNo
>>IF NOT FOUND()</b>
>>  *-- record not part of filtered set, so we
>>  *-- issue a LOCATE which will select the first
>>  *-- record in the filtered set
>>  LOCATE
>>ENDIF
>>
>>
>>>Doesn't work either.... I checked RECNO before and after FILTER call with the "current" record NOT being in the new filter set - RECNO() does not change.
>>>
>>>>Peter,
>>>>You could try the following:
>>>>
>>>>lnRecNo = RECNO()
>>>>SET FILTER TO < whatever >
>>>>*-- attempt to restore the pointer
>>>>GO lnRecNo
>>>>IF lnRecNo = RECNO()
>>>>  *-- previous record is part of filtered set
>>>>  *-- and the record pointer has been restored
>>>>ELSE
>>>>  *-- record not part of filtered set, so we
>>>>  *-- issue a LOCATE which will select the first
>>>>  *-- record in the filtered set
>>>>  LOCATE
>>>>ENDIF
>>>>
>>>>
>>>>HTH
>>< snip >
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform