Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set FILTERS and GO rec problem?
Message
De
30/11/2001 15:24:51
Mike Yearwood
Toronto, Ontario, Canada
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00585621
Message ID:
00588214
Vues:
47
This should work. I particularly like the use of the record scope in the locate. Very clever.

>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 >
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform