General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only