Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem in replacing data
Message
De
28/11/2005 11:37:55
 
 
À
28/11/2005 11:23:55
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01072271
Message ID:
01072490
Vues:
16
>>Hi Chandan,
>>
>>why so much redundant code? I can shorten your code quite a lot:
>>select 0
>>use mbal order acno && Assuming that you have an index tag on acno
>>lnAcno=thisform.acno.value
>>if nKeycode=13
>> if seek(lnAcno) && thisform.. is much slower than a variable
>>  repl date with (myentry.date.value),balance with balance + myentry.credit.value
>
>
>The balance field already gets the myentry.credit.value added, so in this line you're adding it again... Not sure it would keep the balance balanced.

I don't understand what you mean here. These four lines
lnGt=myentry.credit.value
lnBalance=(mbal.balance)
lnBalance=lnBalance+lnGt
repl date with (myentry.date.value),balance with lnBalance
has been replaced with one line, as far as I can see, my one line will do exactly the same job:
repl date with (myentry.date.value),balance with balance + myentry.credit.value
>
>  myentry.balance.value=balance + myentry.credit.value
>>  calc sum(balance) for type="balance"  to lnTc
>>  myentry.tbalance.value=lnTc
>> else
>>   MessageBox('No matching record found!')
>> endif
>>endif
>>Use
>>* close all && Why do you close all???
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform