Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Goto recno('CA_View') reliable?
Message
De
03/02/2017 12:41:53
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01647432
Message ID:
01647441
Vues:
35
>>>I didn't write my example correctly, you are right. I store all values of the RECNO("CA_view") in a cursor (in some rendom order). Then I select that, second cursor, and jump from one record to another. Here a modified code:
>>>
>>>SELECT C_SomeCursor
>>>GO TOP
>>>do while !eof()
>>>     nRecno = C_SomeCursor.Rec_no 
>>>     SELECT ("CA_view")
>>>     GOTO nRecno
>>>     *-- Program does something to a record
>>>     SELECT C_SomeCursor
>>>     SKIP
>>>enddo
>>>
>>>
>>>In the above case, is GOTO method reliable?
>>
>>I don't user CA myself, but I am pretty sure that Goto is reliable. Unless your "does something to a record" is a bunch of stuff, I am pretty sure that all the lines you show can be done in a single SQL Update command.
>
>I wish it were that simple. I will continue relying on GOTO. I have been doing it for a long time but all of a sudden had doubts if this works. Thank you.

It is simple and it will be reliable until the record numbers in your cursor change. They can change in, IIRC, these cases:

- requery() - you may get a completely different set of records, so nRecno may be way beyond current eof() or it may be pointing to a real record but completely different from the record from which the recno() was taken
- new records have negative recno(), but it becomes a positive number after tableupdate().
- zap, but that's trivial
- zap plus insert into / append from, but that's pretty much the same as requery().

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform