Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Having problems with locate.. weird!
Message
De
30/09/2004 12:33:19
 
 
À
30/09/2004 04:23:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00947409
Message ID:
00947566
Vues:
15
>hi thomas,
>
>no, record is not deleted. but i have set deleted on on my form.
>
>here, i have a grid in my form. recordsource is select * from fcab into cursor tbgrid.
>
>i have this code in my command click(),
>
>
>sele fcab
>go top
>locate for recno()=858
>if found()
>[some code]
>endif
>
>
>when i run this form, found returs to .f..
>

>i also find this out, go top does not point the record pointer to 1.

>
>when i sele tbgrid, found returns to .t.
>
>what could be wrong? pls help.

Is there an index set on fcab? GO TOP would point to the first record in the index, not physical, order and RECNO() is therefore unpredictable.

LOCATE FOR RECNO() = < number > could fail if the record is deleted and SET DELETED is ON.
It could also fail if there is a filter set that would exclude that particular record.

If you actually need to go to a specific record number, does GOTO work?

And, at the risk of sounding really silly, I'm still primarily in the FPW world and have very little practical experience with grids and record sources. Is it possible that FCAB has a relation set to another table and that relation fails, resulting in FOUND() not being true?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform