Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid row column calculation problem
Message
From
17/04/2002 00:47:33
 
 
To
16/04/2002 16:52:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00645708
Message ID:
00645798
Views:
9
malloc=0
mnet=0
cfamt=0
If cfqty<=0
** from where comes cfqty? if is a global variable avoid use of.
=messagebox('Sorry Positive Value required...',(0+16+0),' ...')
return .f.
else
** Wy don't use the record field instead of the control.value?
cfqty=thisform.grid1.column5.text1.value
cfamt=thisform.grid1.column6.text1.value

if curreceipt.cfactp <> space(1) AND curreceipt.cfsbcd <> space(6);
AND curreceipt.cfitem <> space(10) and curreceipt.cfunit <> space(3);
AND cfqty > 0 AND cfamt > 0
*cftot=cfqty*cfamt
thisform.grid1.column7.text1.value=(thisform.grid1.column5.text1.value*thisform.grid1.column6.text1.value)
thisform.grid1.column7.text1.refresh()

endi

malloc=0
**
select curreceipt
nrec = recno()
scan for curreceipt.cfactp <> space(1) AND curreceipt.cfsbcd <> space(6);
AND curreceipt.cfitem <> space(10) and curreceipt.cfunit <> space(3);
AND cfqty > 0 AND cfamt > 0

malloc=malloc+cftot

mnet=malloc-mround

endscan
go nrec
thisform.refresh()

endi

Some notes:
- avoid using the column.text.value, use the record field value instead
- Dont't lose the record pointer
- Create a form method and then call it at the lostfocus
- Avoid the use of global variables use Forms properties instead

Hope this help

Mauricio
Be fast like the Fox
Be free like the Penguin
Se Rápido como el Zorro
Se libre como el Pingüino
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform