Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program Design
Message
From
05/10/1999 10:46:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00272685
Message ID:
00272706
Views:
20
>Hello,
> I am having a chance to review a project I just "finished". I wonder if anyone can help me to find a better way to handle the following situation: the project was for an insurance company to calculate and compare different companies' premiums. I used a table called "formula.dbf" to store all the variables and the formulas that I used to calculate each variable in the formula.dbf. Formula.dbf contains these fields: fieldname,formula, condition and active. The codes in the "get_rate" method look like:
> select formula
> go top
> scan while not eof()
> cFieldname = alltrim(fieldname)
> do case
> case cfieldname == "HULL_PREM" AND FORMULA.ACTIVE = .T.
> cWHY = FORMULA.CONDITION
> IF ALLTRIM(cWHY) OR EVALUATE(cWHY)
> cFORMULA = ALLTRIM(FORMULA.FORMULA)
> nHULL_PREM = &cFORMULA
> ENDIF
> case cfieldname == "LIAB_PREM" AND FORMULA.ACTIVE = .T.
> cWHY = FORMULA.CONDITION
> IF ALLTRIM(cWHY) OR EVALUATE(cWHY)
> cFORMULA = ALLTRIM(FORMULA.FORMULA)
> nLIAB_PREM = &cFORMULA
> ENDIF
> ENDCASE
> ENDSCAN
>As you can see, the codes are still considered as hard coded. Things are always change in the insurance industry, I want to find a way that whenever we need to make change to the calculation, we can just add or delete a record from the formula.dbf. Can anyone help.


I would like to see any record's "condition" and "formula" contents from formula before a reply (just as a sample with field types) :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform