>Hi everyone,
>
>i had a database for record my client file, its inculed their photo nubmer. can i make a button call "Dail". I just click the "Dail" button, and the system will help me to dail out. At last i can store the connet time "00:05:33" to a variable.
>
You can access a modem and dial the phone, and then time the duration of the call by recording the starting and ending times as datetime variables. the dureation in seconds is the difference between the two,
>What is the command in the "Dail" CLICK EVENT, and where to get the connect time.
There is no native VFP command to dial the modem for you; you can use an add-on ActiveX control to do this for you. Your best bet would be to purchase a TAPI (Telephony API) ActiveX component to manage the call for you. You could also attempt to do direct manipulation of the modem via a serial port using the MSCOMM32.OCX ActiveX control; this requires a good deal more work to accomplish, and requires at least some knowledge of the command set for the specific make and model of modem in use. You can download examples of using the MSCOMM32.OCX control from the File Section of UT - click on the filing cabinent icon to get there, and then do a search on
MSCOMM.
A TAPI control would require less effort to accomplish the same task, and might be able to automatically record call duration and the like as a part of its services. TAPI components are not free; a good vendor for TAPI controls (and a wide range of other add-ons to Visual FoxPro in general is
Component Source.
Call duration is easy to compute. You can save the current date and time in a DateTime type variable, and subtracting one DateTime variable from another will return a number representing the number of seconds difference. For example:
tStartTime = DATETIME()
*
* do some stuff
*
nSecondsDuration = DATETIME() - tStartTime
You could then store the variable nSecondsDuration to a numeric field in a table, or you could compute hours, minutes and seconds and build a string, saving the string to a character field in a table.
Good luck!
Ed