Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
This will be the first time I can do mathematical functions in foxpro.
1.) What are the functions for add ?'+', substract?'-', multiply ?'*' and divide ?'/'????
2.) Second question is this code....
USE items
NTotal=0
Nsingleprice=0
SCAN
NTotal=(items.price)*(items.discount) && multiply
REPLACE items.discountprice WITH NTotal &&set discount price
Ntotalprice=(items.price)-(items.discountprice)&&substract
replace items.singleprice WITH Nsingleprice && dosingleprice
ENDSCAN
I am trying to do double step -- price $2.00 X 0.10 = discountprice.... then step two I want to take that discountprice -(minus) price X(times)quantity makes totalprice. (I hope and with that I have to do only the records put in for this person customerid! It might be one, two or more articles from the thrift store! We have to put in the discount in the moment since some clothes etc are yellow (10% off) some are green (25%off ) and some are blue (50% off)' So I put the program command button for each percentage (as of today) on the items form and want to do these mathematical calculations on the fly at the moment.
Strange, when I click the button it whites out the grid. I have to shut it off and it comes back again. Any help would be appreciated.
jonezbuz@aol.com
This will be the first time I can do mathematical functions in foxpro.
1.) What are the functions for add ?'+', substract?'-', multiply ?'*' and divide ?'/'????
2.) Second question is this code....
USE items
NTotal=0
Nsingleprice=0
SCAN
NTotal=(items.price)*(items.discount) && multiply
REPLACE items.discountprice WITH NTotal &&set discount price
Ntotalprice=(items.price)-(items.discountprice)&&substract
replace items.singleprice WITH Nsingleprice && dosingleprice
ENDSCAN
I am trying to do double step -- price $2.00 X 0.10 = discountprice.... then step two I want to take that discountprice -(minus) price X(times)quantity makes totalprice. (I hope and with that I have to do only the records put in for this person customerid! It might be one, two or more articles from the thrift store! We have to put in the discount in the moment since some clothes etc are yellow (10% off) some are green (25%off ) and some are blue (50% off)' So I put the program command button for each percentage (as of today) on the items form and want to do these mathematical calculations on the fly at the moment.
Strange, when I click the button it whites out the grid. I have to shut it off and it comes back again. Any help would be appreciated.
jonezbuz@aol.com