Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Matrix rate
Message
From
28/06/1999 14:50:03
Dovi Gilberd
Dovtware Consulting Inc
Miami, Florida, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Matrix rate
Miscellaneous
Thread ID:
00234901
Message ID:
00234901
Views:
58
im using this function to detrmine a rate for a customer

my rate table (named rates) looks like this

code countyr rate1 rate2 rate n
011575 Colombia .23 .24 .28

what this function is doing so far is bringing me in the grid the correct name of the rate that im using for this customer..customer rates are preset in the customer table named long_distance.rate

what is the next step to compare using the if statements that i have underneath to the number dialed to detrmine the correct price uner the corrcect name...?
can anyone help me out here....

FUNCTION getrate()
PARAMETERS Result

cRateField="long_distance.rate"
dial="view1.dialednr"
select rates
set order to tag code

IF LEFT(view1.dialednr,1)='0'
SEEK LEFT(view1.dialednr,6)
endif

IF LEFT(view1.dialednr,1)="#"
SEEK LEFT(view1.dialednr,3)
endif


if LEFT(view1.dialednr,1)='1'
SEEK LEFT(view1.dialednr,4)
ENDIF


RETURN eval(cRateField)
Next
Reply
Map
View

Click here to load this message in the networking platform