Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with a GOTO recnum
Message
De
01/03/2009 02:25:53
 
 
À
28/02/2009 16:07:07
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01384533
Message ID:
01384805
Vues:
33
All these years and still so much to learn!
replace stuff with otherstuff in mytable record cur.myrecnum
With, as you said, all the different ways you can do things, I never realized that < scope > could apply to a table outside the current work area.



>>I don't know why the following would work where your code doesn't, but alternate techniques sometimes work for no apparant reason
>>
>>SELECT myTable
>>lcOrder = TAG()
>>SET ORDER TO
>>
>>SELECT RECNO() AS MyRecnum,Field1,Field2 FROM MyTable INTO CURSOR cur READWRITE
>>
>>Do stuff with Cur
>>
>>SELECT cur
>** >SET RELATION TO myRecnum INTO myTable
>>SCAN FOR Condition met
>** >    SELECT myTable
>**>    Update Stuff IN myTable
>** how about
>      replace stuff with otherstuff in mytable record cur.myrecnum
>>ENDSCAN
>>
>>SELECT cur
>>SET RELATION TO
>>SELECT myTable
>>SET ORDER TO (lcOrder)
>
>Note that I've commented out the relation as well.
>We can play like this because we can write into a record in several ways - replace, update, gather, insert, and we can navigate to it also in several ways - scope clause (record n, all, rest, next n), for/while clause, where clause in sql update, by index (seek command, seek function, indexseek, keymatch), using locate... and all of this with a filter or not, under influence of a filtered index or not... so, any of these can be written in about twenty ways (three is the minimum - if it can't be done in Fox at least three ways, it's not worth doing).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform