Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Grumpfish Library 3.2 - <b>popphone()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
POPPHONE()

    This application allows you to maintain a phone database with names,
    addresses, and phone numbers of business and personal contacts. If
    you have a modem, you can dial any of the phone numbers in your
    database.  You may also print mass mailings to some or all names in
    the phone file.

    The phone directory utilizes two files, PHONE.DBF and PHONE.NTX.
    You do not need to create these files; the application automatically
    generates them if it cannot find them in the specified subdirectory.
    The structure for PHONE.DBF is as follows:

    Field name   Type      Width

    FNAME        Character    15
    LNAME        Character    15
    PHONE_NO     Character    12
    EXT          Character     4
    COMPANY      Character    20
    ADDRESS      Character    25
    CITY         Character    15
    STATE        Character     2
    ZIP          Character     5
    LONGDIST     Logical       1

    The index key for PHONE.NTX is "UPPER(lname + fname)".

    The user interface is a browse-style window.  You can view, add,
    edit, delete and search for records from the phone database.  You
    can instruct the application to search a specific subdirectory for
    the database file by initializing a memory variable named 'phonedir'
    with the value of the desired directory (example: "C:\PHONE").  If
    'phonedir' is not defined in your program, the current directory
    will be used.

    Active Keys

    A - add a record to the database
    E - edit highlighted record
    D - delete highlighted record
    S - search for record
    UpArrow - move up one record in window
    DnArrow - move down one record in window
    Esc - exit the phone directory
    Alt-A - view/edit address information for highlighted record
    Alt-L - print list of all names in directory
    Alt-M - mass mailing to all or selected names
    Alt-P - dial highlighted phone number
    Alt-R - redial previously dialed number
    Alt-S - setup communications parameters

    The field labeled "LD" is for long-distance. In situations where a
    person has the same area code as you, yet is a long-distance call
    away, you would want to set the long-distance field for that person
    to Yes ("Y").  The value of this field is irrelevant if the person's
    area code does not match yours.

    When you add new names, the phone number will include your local area
    code as a default.  It is strongly suggested that you include area
    codes with each phone number, even those that are local calls.

    Address Information

    Press Alt-A to view and/or edit address information for the highlighted
    person.  A box containing that information will appear in the middle
    of the screen.  You may enter information in these fields as
    desired.  You can then press Ctrl-W to save your edits, or Esc to
    exit without saving.  Either way, you will be returned to the browse
    window.

    Phonebook

    Press Alt-B to print a pocket-sized phonebook of all the names in
    your phone database.  The phonebook will include names, addresses
    (if applicable), and phone numbers, and will be sorted by last name.

    Lists

    Press Alt-L to print a list of the names in your phone database.
    You will be asked to select the sort order: (1) by last name; (2) by
    company; or (3) by phone number. Pressing Esc at this prompt will
    abort the printing process.  You may customize the heading on this
    report by defining a PUBLIC variable named PHONEHEAD in the calling
    routine.  See below for an example of this.

    Auto-Dial

    Press Alt-P to dial the highlighted number (first, make sure that
    your modem is hooked up and turned on).

    Phone numbers that include area codes different from your local area
    code are presumed to be long-distance, and will be preceded by "1"
    as is the current norm.  Numbers that include area codes matching
    your local area code will be dialed as local calls, unless you have
    set the "LD" (long-distance) field to True ("Y") for that person.
    Phone numbers without an area code are presumed to be local, and are
    dialed as is. You may include letters as part of the phone number
    (e.g., "MU5-2512"); the program will convert any letters to their
    numeric equivalent on the standard telephone keypad.

    Please note: if you encounter difficulties with the auto-dialer, you
    may have to call the DOS "MODE" command before running your Clipper
    program.  Sample syntax for MODE is:

    MODE COM1:24,N,8,1,P

    This sets communications port 1 at baud rate 2400, with no parity,
    8 bits, and 1 stop bit.  Please refer to your DOS manual for more
    specifics.

    Redial

    Whenever you dial a number, that number is saved as the redial
    number. You may later redial it simply by pressing Alt-R.  You do
    not have to highlight the same person.  If no number has been
    established as the redial number, you will receive a message to that
    effect.

    Communications Parameters

    Press Alt-S to set up your communications parameters. These include:

    - PBX: if this is on, all numbers dialed will be preceded by a "9"
    and a half second pause.

    - Modem initialization string: sent to the modem before dialing the
      number.

    - Modem hangup string: sent to the modem after the call is terminated.

    - Tone/Pulse: set this to "T" for Tone dialing or "P" for Pulse dialing.

    - COM port: selects the COM port to use for dialing.

    - Local Area Code: your area code - used to preclude dialing the area
      code on local calls.

    - Timing Delay: this parameter exists because some modems like
      to wait longer than others between commands.  The default is one
      second. If you are experiencing timing problems, try increasing
      this value to 1.5 or 2.0 seconds.

    The variables for these six items are GFPHONPBX, GFPHONHANG,
    GFPHONINIT, GFPHONTONE, GFPHONPORT, GFPHONAREA, and GFPHONTIME,
    respectively. When POPPHONE() is run for the first time, it will
    create the memory variable file GFPHONE.MEM, which is used to store
    these variables. If it detects this file, it will use the values
    stored therein.

    When you edit these items in the communications parameters window,
    you will be asked if you wish to save the values permanently.  If
    you press "Y" for Yes, the variables will be written to the
    GFPHONE.MEM file. Otherwise, your changes will only apply for the
    current session. (Important 5.0 Change: the filename to store
    these variables is GFPHONE.CFG.  This filename is stored at the
    top of POPPHONE.PRG and can be changed quite easily.)

    Using the Phone Directory in your programs

    As with the calculator, there are two methods to choose from.  The
    first is to use SET KEY to establish a hot-key so that you can pop
    up the phone directory anywhere within the program.  The following
    lines added at the top of your program configures the F7 key to
    serve as the hot key, instructs the program to look for the phone
    database in the subdirectory "C:\PHONE" and specifies the heading to
    use on the report:

    *** Summer '87 syntax                                  
    EXTERNAL popphone             && make symbol for linker
    phonekey = -6                 && hot key: F7           
    phonedir = 'C:\PHONE'         && search directory      
    phonehead = 'My Pals'         && report heading        
    SET KEY phonekey TO popphone                           

    // Clipper 5.0 syntax                      
    #include "inkey.ch"                        
    phonedir := 'C:\PHONE'  // search directory
    phonehead := 'My Pals'  // report heading  
    SET KEY K_F7 TO popphone                   

    If you want to use a different hot key for the phone directory,
    please refer to your Clipper manual for a list of INKEY() values.

    The second method is to call the phone directory directly.  Refer to
    the Calculator discussion for a sample menu.

    Clipper 5.0 Notes

    - The separate Alt-A option has been eliminated. Address information
      is now maintained at the same time as the name and phone number.
    - All PUBLIC variables have been eliminated.
    - The modem parameters are maintained as STATIC variables.
    - It is no longer necessary to declare the variable PHONEKEY when
      assigning a hot key.
    - It is no longer necessary to declare POPPHONE as EXTERNAL, because
      SET KEY will automatically establish a symbol for the function.
    - Modem settings are stored in GFPHONE.CFG, rather than GFPHONE.MEM.

See Also: POPCALC() GINKEY()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson