>hi barbara...how are you...i'm sorry to bother you again..
>2 questions..why do i need the lsuccess..?
>i took it of and i get as a result a false answer for all the calls
>im using it like this..
>
>
function rate()
> lparameter dialednr, code, calcrate, rate, n
> LOCAL y
>
> 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
>
> endif
> endfor
>y=rate
>return rate
>endfunc
>
>what am i doing wrong
If you don't pass
rate as a parameter explcitly in, it'll default to a logical false. If you never find a hit on the field test, rate never gets assigned, so you return the defaulted value of .F.
I'd guess that code doesn't contain a valid field name, or isn't in all upper case, or has leading or trailing blanks, or maybe an alias prefix, so that the field names never match the code parameter, or the SEEK failed, so that the compares all fail. A little defensive coding (and adding some ASSERTs to aid in debugging) would probably point up the error quickly.