Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does record pointer past EOF()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00064257
Message ID:
00064409
Vues:
51
>>>>>Anyway, the problem is that Delete sometimes places you at eof() already, so you can't Skip without an error. I was trying to use code such as yours, originally.
>>>>
>>>>Can you give me an example? I NEVER saw a case when the DELETE (with no other clauses) moves the record pointer. And I would really want to see it if this can happen. This would be a HUGE bug. I also assume that you don't have a stored procedure/RI that plays with the rec pointer.
>>>>
>>>That's what I thought, too. It occurs with a view and buffered table, but only sometimes when deleting last record, under network shared situation for table...but I don't have the code here at home...I'll have to check it some more next week, but the code I gave does fix the problem...
>>
>>I know it fixes the problem. But it looks more like an workaround (see also my reply to Allan). I would like to know/determine the exact conditions when this can happen. It never occured to me in any FoxPro version and I would like to be aware of it. I just hate this type of bugs. :)
>>
>More Info: Here's the code the Wizard now has for its Delete button:
>
>delete
>if not eof()
>  skip 1
>else
>   if eof() and not bof()
>      skip -1
>   endif
>endif
>
>This leads me to suspect that it is (now?) possible to hit eof() on a delete. Why else would MS vfp coders do it this way?

Don't use wizard generated code to learn about "good VFP programming technics"!! :) It's good enough if that code works at all! :)

BTW, in the code sample you give, why do they test for eof() on the "else" branch of the first "if"? Is it necessary? Nope! :) Do I have to assume that in some cases, the negation of "not eof()" might be something different from "eof()"? :)))

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform