home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / CLIPDL11.ZIP / DIALER.PRG < prev    next >
Encoding:
Text File  |  1987-12-17  |  3.7 KB  |  99 lines

  1. *:*********************************************************************
  2. *:
  3. *:      Program: DIALER.PRG
  4. *:
  5. *:       System: Clipdial Intelligent Phone Dialer V#1.1
  6. *:       Author: Glendon G. Todd / Vega Group
  7. *:    Copyright (c) 1987, Public Domain by the Author
  8. *:
  9. *:         Uses: CLIPDIAL.DBF
  10. *:
  11. *:      Indexes: CLIPDIAL.NDX
  12. *:
  13. *: Documented: 12/17/87       18:23                   SNAP! version 2.01
  14. *:*********************************************************************
  15.  
  16. *  This is the "brains" of the Clipdial intelligent dialer.     Clipdial
  17. *  expects to be passed a complete 10-digit phone number in the format
  18. *  (999) 999-9999.     Be sure to include the space after the ")".  
  19. *  Clipdial extracts the area code and exchange information from the phone
  20. *  number and uses this to determine whether the number is local or long
  21. *  distance.     For a local call, Clipdial strips off the area code
  22. *  information and dials the 7-digit local number.     For a long distance
  23. *  number, Clipdial prefixes the number with "1-", and then dials the
  24. *  complete long distance number.     Clipdial also checks the DSR line
  25. *  coming from the modem.     If DSR is not asserted, Clipdial assumes that
  26. *  the modem is not on and aborts with an error message.
  27.  
  28. *  Clipdial uses the database file Clipdial.dbf to keep track of what
  29. *  telephone exchanges are in the local calling area.     This database 
  30. *  must be in the current default directory or on Clipper's PATH.     (Not
  31. *  the DOS path.)     If Clipdial does not find this database file, it will
  32. *  dial the phone number exactly as passed to it.     Clipdial uses Clipper's
  33. *  work area 10 for it's database file.     Anything else in work area 10 
  34. *  will be lost.
  35.  
  36. *  This copy of Clipdial is currently configured for the metro Washington
  37. *  D.C. area.     However, it is easy to reconfigure for any other area of 
  38. *  the country.     The string "703/212/301" in line #60 tells Clipdial
  39. *  what area codes the local calling area is contained in.     Simply replace
  40. *  this string with a string containing your local area code(s).     Then the
  41. *  Clipdial.dbf file must be edited (using dBase or some such) so that it
  42. *  contains the exchange codes which are within your local calling area.
  43. *  (There is a list of these exchanges in the front of your phone book.)
  44.  
  45. *  For support, comments, questions or whatever, contact :
  46. *
  47. *                             Glendon Todd
  48. *                             312 Van Buren St.
  49. *                             Falls Church, VA    22046
  50. *                             Compuserve 71121,352
  51. *                             Voice (703) 532-8191
  52.  
  53. *        Revision history
  54. *
  55. *           11/26/87 - Version 1.0 - first public domain release
  56. *
  57. *           12/17/87 - Version 1.1 - Repaired a bug in 1.0 which was causing
  58. *                                      it to create it's index improperly.
  59.  
  60. parameters phone_no
  61.  
  62. mdial_num = phone_no
  63. acode = substr(phone_no,2,3)
  64. exchg = substr(phone_no,7,3)
  65. if file("clipdial.dbf")
  66.    mdial_num = "1 "+phone_no
  67.    if acode $ "703/212/301"
  68.       database = alias()
  69.       select 10
  70.       if file("clipdial.ntx")
  71.          use clipdial index clipdial
  72.       else
  73.          use clipdial
  74.          index on exchange to clipdial
  75.       endif
  76.       seek exchg
  77.       if .not. eof()
  78.          mdial_num = substr(mdial_num,9,8)
  79.       endif
  80.       use
  81.       select &database
  82.    endif
  83. endif
  84.  
  85. if dsr()
  86.    mdial_num=LTRI(TRIM(mdial_num))
  87.    call modemcmd with "DT"+mdial_num
  88.    @23,10 say "Wait for ring, then pick up phone and press spacebar, please!"
  89.    do while inkey()=0
  90.    enddo
  91.    call modemcmd with "H0"
  92.    *   clear
  93. else
  94.    @12,20 say "Modem is not on"
  95. endif
  96. return
  97.  
  98. *: EOF: DIALER.PRG
  99.