home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / pmcom233.zip / SAMPLE.C < prev    next >
C/C++ Source or Header  |  1996-01-02  |  2KB  |  38 lines

  1. /*This script can be compiled with either the cpmcom32.lib or the           */
  2. /*cpmcomm.lib. If you are compiling the program as a 32bit program then use */
  3. /*the cpmcom32.lib. This script will dial the entry in your dialing directory*/
  4. /*named Compu-Plane. Make sure this entry exists. Replace the first,last, and*/
  5. /*password fields in the put_s statements. The cpmcomm.lib is a large model */
  6. /*library.*/
  7.  
  8. #include <stdio.h>
  9. #include "cpmcomm.h"
  10.  
  11. int main(int argc,char **argv)
  12. {
  13.     CHAR *filearray[1];
  14.  
  15.     if(!init_lib(argc,argv)) /*This function initializes certain variables */
  16.     {                        /*for use by the .lib functions.               */
  17.         printf("Error in init_lib!\a\n");
  18.         sleep(5000);
  19.         return(1);
  20.     }
  21.     change_option("exit on hangup=ON"); /* This will make Pmcomm exit once  */
  22.                                         /* you have logged off from the BBS.*/
  23.     put_s("Dialing Compu-Plane\r\n\n", screen_handle);
  24.     sleep(1000);
  25.     dial("Compu-Plane");     /*This function will dial the entry Compu-Plane*/
  26.                              /*in your dialing directory. This entry must   */
  27.                              /*exist in order for this script to work.      */
  28.     filearray[0] = "name?";
  29.     wait_fore(1, filearray, port, screen_handle); /*Wait for the word name? */
  30.     put_s("first\r", port); /*Replace the word first with your first name.  */
  31.     wait_fore(1, filearray, port, screen_handle); /*Wait for the word name? */
  32.     put_s("last\r", port);  /*Replace the word last with your last name.    */
  33.     filearray[0] = "password?";
  34.     wait_fore(1, filearray, port, screen_handle); /*Wait for the word password? */
  35.     put_s("password\r", port); /*Replace the word password with your password*/
  36.     return(0);
  37. }
  38.