Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GOTO on Filtered data
Message
 
 
À
18/11/2004 22:15:52
Ken Dibble
Southern Tier Independence Center
Binghamton, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00962533
Message ID:
00962883
Vues:
10
The GOTO < Record # > command pays no attention to SET FILETER or SET DELETE ON. When BROWSE command runs, it issues implicit LOCATE if current record doesn't satisfy filter conditions.


>
>I was going to suggest that you *can't* get back to that record because under your filter, it's no longer visible. It doesn't exist in this view of the table; that's why it's "out of range". So I started messing around with some simple demo code, and I discovered this:
>
>
>RELEASE ALL
>CLEAR ALL
>CLEAR
>
>LOCAL x, nRec
>
>CREATE CURSOR foo ( ;
>     IntField I, ;
>     CharField C(10) )
>
>FOR x = 1 TO 10
>     INSERT INTO foo (IntField, CharField) ;
>     VALUES (x,TRANSFORM(x))
>ENDFOR
>
>GO 2
>
>nRec = RECNO()
>
>? nRec  && 2
>
>? CharField  && "2"
>
>SET FILTER TO NOT ALLTRIM(CharField) == "2"
>
>LOCATE
>
>BROWSE  && The record that contains "2" isn't visible, pointer is on record 1
>
>? CharField  && "1"
>
>GO nRec
>
>* With this commented out, the next line returns "2", which should be
>* impossible, because that record isn't visible; it's excluded by the filter.
>* If this line runs, the browse window shows the record pointer on the second
>* record, where CharField = "3", and the next line returns "3", which is what
>* should happen with or without the BROWSE.
>*BROWSE
>
>? CharField
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform