Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending doing replacing
Message
De
20/06/1998 13:31:10
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00110241
Message ID:
00110252
Vues:
29
>>>>Michel reading quickly maybe I'm also missing but after "use keylist in 0" you don't select keylist so locating in current (which is most likely EOF).
>
>I found the problem. When it runs the "getkey" code, that changes the current work area to the one for "keylist". When it's done running it, it doesn't put it back in the right work area.
>
>If I do append blank, select clients, append blank, it works. I still don't understand why it would append on top of the old record, though.
>
>Thanks,
So Michel,
To prevent it I suggest open keylist on entry and keep it open. Never select it but do a seek+replace.
proc getkey
parameter lcKeyName

local lnKeyNum

*use KeyList in 0   && Already opened and has a tag for keyname as ie: keyindex

if seek(alltrim(lcKeyName),"keylist","keyindex")
   replace KeyList.KeyNum with KeyList.KeyNum + 1
   lnKeyNum = KeyList.KeyNum
else
   lnKeyNum = 0
endif

return lnKeyNum
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform