Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem in replacing data
Message
From
28/11/2005 14:46:15
 
 
To
28/11/2005 12:52:33
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01072271
Message ID:
01072581
Views:
17
>>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
>
>So you've added the credit value to balance field. That's fine, no problem there. The problem is in the next line, where you're adding it again:
>
Yes, I see it now. I removed one "redundant" variable, but forgot to move one line before I posted my message. Here's the (hopefully) correct version
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
  myentry.balance.value=balance + myentry.credit.value
  repl date with (myentry.date.value),balance with myentry.balance.value
  calc sum(balance) for type="balance"  to lnTc
  myentry.tbalance.value=lnTc
 else
   MessageBox('No matching record found!')
 endif
endif
Use
>>>
>  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???
Previous
Reply
Map
View

Click here to load this message in the networking platform