Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Matrix rate
Message
From
27/06/1999 20:13:46
 
 
To
27/06/1999 19:07:46
Dovi Gilberd
Dovtware Consulting Inc
Miami, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00233562
Message ID:
00234593
Views:
26
>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform