Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field Copy
Message
From
28/06/1999 02:29:10
 
 
To
28/06/1999 02:23:54
Dovi Gilberd
Dovtware Consulting Inc
Miami, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00233837
Message ID:
00234640
Views:
35
Dovi --- Assuming that all the tables are open with the right indexes set and pointing at the right records (except for rates, where we need a lookup) the code is rewritten as follows (you need to pass nResult to the function as is nMyBill=GetRate(nMyTime)):
FUNCTION getrate()
PARAMETERS nResult
cRateField="rates.rate"+cCode
IF LEFT(view1.dialednbr,1)="0"
   SEEK LEFT(view1.dialednbr,6) TAG code IN rates
ELSE
   SEEK LEFT(view1.dialednbr,4) TAG code IN rates
ENDIF
RETURN EVAL(cRateField) * nResult
cRateField holds a reference to which rate field...get it?






>john....!?
>going crazy here...
>This is the original function you sent me....!
>
>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

>
>the field that specifies what rate to use for my customer is
>Long_distance.rate
>
>can you do me a favor..fill in the names if the function with my original names...Please..
>Cause i dont know wher you gotcratefield....is it the same as long_distance.rate...
>And also i did not knwo the part of rate+ccode...
>
>help me out men....? Thanks..
>
>
>
>
>
>
>
>
>
>>>>If something is not working with TAG in SEEK, use SET ORDER TO before the SEEKs instead :-)
>>>>
>>>>>john thank you...something does not seem to be working with the tag commmand..
>>>>>thankyou for being patient with me...Got to finish this by tomorrow..
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>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