Auto calculated field in Foxpro (2.6 prefered)
There are few fields in foxpro database say a,b,sum,product. I want to enter value in a and b and want sum and product field auto calculated - so that I don't have to put values there anbd quickly enter next value in next record.
Computers & Internet - Microsoft - Visual FoxPro Professional Edition 7.0 for PC
Answers & Comments
Code example:
// all fields are numeric type
USE example APPEND BLANK REPLACE field_a WITH 25, field_b WITH 4, field_sum WITH field_a + field_b, field_prod WITH field_a * field_b APPEND BLANK REPLACE field_a WITH 60, field_b WITH 5, field_sum WITH field_a + field_b, field_prod WITH field_a * field_b
Result: field_a field_b field_sum field_prod 25 4 29 100 60 5 65 300
Don't use keywords as field names (ex. SUM).
Best regards