Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with a GOTO recnum
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01384533
Message ID:
01384544
Vues:
54
>Hi.
>Has anybody had any problems with GOTO recnum. I have an app which seems to fail on this
> intermittently and cant see any reason for it.
>My code is as follows:
>Select Recno() as MyRecnum,Field1,Field2 from MyTable Into Cursor Cur Readwrite
>Do stuff with Cur
>Sele Cur 
>Goto top
>DO WHILE OT EOF()
>    If Condition met
>        Sele MyTable
>       Goto Cur.MyRecnum
>       Update Stuff
>   Endif
>
>  Sele Cur
>  Skip
>Enddo
>
>What seems to be happening, again infrequently , but I cannot see a pattern,
> is that the last record in MyTable is updated instead of the MyRecnum record
>
>Any ideas on this would be appreciated
>Regards.
>Gerard

Why you're not using SCAN/ENDSCAN and is your UPDATE stuff is really a replace command with

replace ... IN myTable ?

Finally, I always check with this
if between(lnRecno, 1, reccount('myTable'))
  goto lnRecno in myTable
endif
just in case
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform