General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
hi barbara i am very sorry to keep botheing you, you have been of great help to me..
the function is not working properly i get a false as a result
do i need the lsuccess...you are missing either another parenthesis or a few things that i cannot figure out.
can you pleas give me one more try....please,,,,????
im triying hard here...im trying to put this lines in the function you are helping me out
if left(view1.dialednr,1)="0" &&if the number dialed starts by 0 take
first 6 digits to compare to rate
seek left(view.dialednr,6)
endif
if left(view1.dialedr,1)="1" &&if the number dialed starts by 1 take
first 4 digits to compare to rate
seek left(view1.dialednr,4)
endif
please help me out...? the thing is that i need to finish this for tomorrow and i've been all day trying to do this.....Thank you
>lSuccess = rate(dialdnr, code, @CalcRate, @rate, @n,
>
>function rate()
>lparameter dialednr, code, calcrate, rate, n
>LOCAL lSuccess
>lSuccess = .F.
>
>select rates
>set order to tag code
>seek left(view1.dialednr,6)
>for n=1 to fcount()
> if field(n)=upper(code)
> rate = eval(field(n))
> calcrate = rate*result
> lSuccess = .T.
> endif
>endfor
>
>return lSuccess
>Note that the values you need are returned by reference because you called them with the @ since in front of the parameters.
>
>You WILL have to adjust this to use your specific fields, but I hope this will get you started.
>
>Barbara
>
>>Hi barbara..how are you...im sorry to bother you..im stil dealing with the rate...im very new to fox, but im defending
>> myself however i can...boks, forums,,etc....Im sorry to bother you..please help me
>> regarding this..
>>
>> i created a function in my main program called rate()
>> like this
>>
>> key things about my problem
>> customer table's name is long_distance
>> the field in customers where i set the rates is long_distance.code
>> the calls made are in view1
>> the field that has the calls is named dialednr
>>
>> my rates table name is Rates and it looks like this
>>
>> code country rate 1 rate 2 rate n
>> 011575 Colombia .23 .24 .25
>>
>> i know that John doe has rate 2, and he made a call to 01157587654..
>> then that all with rate 2 to colombia should be billed at .24
>>
>> Now first i neeD to compare the first digits of the call against the rate table to see which country was called
>> if dialednr starts with 0 then take left 6 of dialednr compared with rates.code
>> if dialednr starts with 1 then take left 4 of dialednr compared with rates.code
>> then i need to compare long_distance.code (rate asigned) the correct column of rates table( meaning if john doe
>> had rate 3, make sure that it uses the fith column of rates table..
>> now that i know the rate and the country i could knwo the rate
>>
>>
>> im triying with this function to doit but its not working properly..
>> CAN YOU PLEASE HELP ME OUT....I COULD PAY YOU FOR YOUR SERVICES...
>>
>>
>> function rate()
>> lparameter dialednr,code,result,result,n
>> select rates
>> set order to tag code
>> seek left(view1.dialednr,6)
>> for n=1 to fcount()
>> if field(n)=upper(code)
>> return eval(field(n))*result
>> endif
>> endfor
>> rate=n
>> return rate
>> endfunc
>> return rate
Previous
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