Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copying a record
Message
 
 
À
05/09/2000 18:21:41
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00412653
Message ID:
00412913
Vues:
14
>>>Anyone know the fastest, easiest, cleanest way to copy a record. The only thing I don't want copied is the cID field that gets updated with newid(). Everything else needs copying.
>>>
>>>BTW --- APPEND FROM ARRAY doesn't update cID
>>>
>>>
>>>Thanks 4 your help.
>>
>>In general you can use:
>>scatter memvar memo
>>m.cID=newID()
>>append blank
>>gather memvar memo
>
>
>Rather than using SCATTER/GATHER MEMVAR, I've found it far better to use SCATTER/GATHER NAME, which creates an object:
>
>SCATTER NAME oTemp MEMO
>oTemp.cID = newID()
>APPEND BLANK
>GATHER NAME oTemp MEMO
>
>If the table automatically assigns a default value on adding a new record, this should read:
>
>SCATTER NAME oTemp MEMO
>APPEND BLANK && default ID assigned on APPEND
>oTemp.cID = cID
>GATHER NAME oTemp MEMO

Thanks, Ed. Do I need to release oTemp after finishing? Actually, I usually use the technique, I described, directly from command window, when I want to quickly copy a record content to another new record (I may now change this approach to 3 lines, like Eric showed). Could you please tell me, what are the advantages of using your technique, except for personal privillegies ( spelling?)?

Thanks in advance.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform