Information générale
Catégorie:
Codage, syntaxe et commandes
>>>2. REPLACE YourColumn WITH SomeValue IN YourTable -&& Put this code there where you want to update cursor
>>
>>needs the "for empty(YourColumn)" at least (which takes care of the implicit "!IsNull/YourColumn)" of if)
>>
>>IMO code not caring for record pointer move (same as in orig code) is bad style.
>>Therefore I'd opt for SQL - update and second line moving record pointer explicit if really intended,
>
>That's why we have the use again option... simply
>
>use dbf("myCursor") again in 0 alias "myAlternateCursor"
>then select that, do there whatever you need to do, close it, go back and refresh your grid.
>Worked every time and didn't touch the record pointer.
Which is what SQL update does as well - opens in new workarea, changes and closes again
My rule of "good code" is use replace on current or single record, SQL update on table (subset),
as it is succinct (less lines) and gives me subconcious hint on what is happening on table or rec level.
we are both old dogs ;-)
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement