Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field Copy
Message
From
27/06/1999 23:31:17
 
 
To
27/06/1999 08:23:43
Dovi Gilberd
Dovtware Consulting Inc
Miami, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00233837
Message ID:
00234613
Views:
29
Hi Dovi ---

We'll solve this yet :-)

Let's see if I have this right. The customers are in a table called "long_distance" with the following significant fields:
code (which is the rate code 1..2...3..etc).
Theer is a view, view1, which I assume is a child of long_distance which contains the calls. A significant field in view1 is dialednr with is the number the customer dialed. So far correct?

Now, the rate table is (code,country,rate1,rate2,..raten)

I am assuming that "result" in your sample code is a time factor, like how many minutes?

And you need to solve a given rate for a given view1 record, right? Try this:
FUNCTION getrate()
PARAMETERS cDialednbr,cCode,nResult
cRateField="rates.rate"+cCode
IF LEFT(cDialednbr,1)="0"
   SEEK LEFT(cDialednbr,6) TAG code IN rates
ELSE
   SEEK LEFT(cDialednbr,4) TAG code IN rates
ENDIF
RETURN EVAL(cRateField) * nResult
Try this :-)
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform