FOXPRO PHONE SYSTEM/REAL TIME DEVELOPEMT 
Author Message
 FOXPRO PHONE SYSTEM/REAL TIME DEVELOPEMT

I am developing an automated phone system using Foxpro2.6/dos and windows
This program is intended to work unattended using a buffer box(Tapit).
Problem:
How can I make time calculations such as:

starting time(field)
taken from ending time (field) times rate = cost

5

333



Thu, 20 Nov 1997 03:00:00 GMT
 FOXPRO PHONE SYSTEM/REAL TIME DEVELOPEMT

Quote:
>I am developing an automated phone system using Foxpro2.6/dos and windows
>This program is intended to work unattended using a buffer box(Tapit).
>Problem:
>How can I make time calculations such as:
>starting time(field)
>taken from ending time (field) times rate = cost

Try looking at the SECONDS() command.

starttime = seconds()

do stuff

ElapsedTime = seconds() - starttime

Jack Linder



Fri, 21 Nov 1997 03:00:00 GMT
 FOXPRO PHONE SYSTEM/REAL TIME DEVELOPEMT

Quote:

>I am developing an automated phone system using Foxpro2.6/dos and windows
>This program is intended to work unattended using a buffer box(Tapit).
>Problem:
>How can I make time calculations such as:

>starting time(field)
>taken from ending time (field) times rate = cost

You could try this

*returns time in minutes

* convert StTime and EndTime to a numeric
* start and end are in seconds

  start = LTRIM(LOWER(StTime))
  start = VAL(SUBSTR(start,1,2))*3600 +;
    VAL(SUBSTR(start,4,2))*60 +;
    VAL(SUBSTR(start,7,2))

  end = LTRIM(LOWER(EndTime))
  end = VAL(SUBSTR(end,1,2))*3600 +;
    VAL(SUBSTR(end,4,2))*60 +;
    VAL(SUBSTR(end,7,2))

  tot = (end-start)/60
 * Rate in minutes
   rate = 1.50
  charge = tot * rate

Sue Jones
HyperWindows Inc.



Fri, 21 Nov 1997 03:00:00 GMT
 FOXPRO PHONE SYSTEM/REAL TIME DEVELOPEMT
Quote:

>  I am developing an automated phone system using Foxpro2.6/dos and windows
>  This program is intended to work unattended using a buffer box(Tapit).
>  Problem:
>  How can I make time calculations such as:
(snip)

There are a couple of answers posted, but both neglect time that span midnight.  

You might want to consider that unless the app will only run when this can't happen!

Larry



Fri, 21 Nov 1997 03:00:00 GMT
 FOXPRO PHONE SYSTEM/REAL TIME DEVELOPEMT

Quote:

>I am developing an automated phone system using Foxpro2.6/dos and  
windows
>This program is intended to work unattended using a buffer box(Tapit).
>Problem:
>How can I make time calculations such as:

>starting time(field)
>taken from ending time (field) times rate = cost

First you need the elapsed time in seconds (or whatever unit you measure  
in)

Don'te forget to account for starting and ending times spanning two or  
more days.

s_date = DATE()
s_time = SECONDS()

* time passes...

e_time = SECONDS()
e_date = DATE()

secs_in_day = (24*60*60)  && seconds in a day

elapsed = (((e_date-s_date)*secs_in_day)+e_time) - s_time

you now have elapsed time in seconds.  The trickk is to make the ending  
time relative to the starting time with respect to elapsed days as well  
as seconds since midnight.

Anyone else feel free to jump in a correct me if I missed something...  
I'm sure this has been done by sharper individuals than myself, possibly  
in a more elegant manner.

Hope this helps you out...

Jeff

=========================================================================  
==========
 Jeff Davis
 E-Mail..................................................  

 Snail Mail.............................................. Petra  
Informatics
                                                          4301 Stine Road
                                                          Suite H
                                                          Bakersfield, CA  
93313
                                                          USA
 Voice................................................... 805.398.2296
 Fax..................................................... 805.398-2296
 Home Page...............................................  
http://www.netxn.com/
=========================================================================  
==========



Sun, 23 Nov 1997 03:00:00 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. FOXPRO 2.5 FOR WINDOWS REAL-TIME SYSTEM

2. FoxPro 2.x for Windows Accessing Caller ID phone system

3. real time clock Foxpro 2.6

4. Displaying real time in Foxpro

5. Real-Time FoxPro??

6. Non real time replication system

7. SQL Server for Real Time Systems - Need much suggessions

8. US-NJ-Seeking Java SW projects for event driven real time systems

9. CFP - IEEE Real-Time Systems Symposium 1998 (RTSS '98)

10. High throughput real-time system in JDBC?

11. Call For Papers -- IEEE Real-Time Systems Symposium 1998

12. DC-Washington-249714--Software Engineer-C++-CORBA-Java-ORACLE-Real Time Systems-


 
Powered by phpBB® Forum Software