home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / n / newscr.zip / NEWSCR.EXE / DATAPAC.SCR < prev    next >
Text File  |  1993-01-04  |  2KB  |  63 lines

  1. !---------------------------------------------------------------------!
  2. !                                                                     !
  3. !  Copyright (c) 1991                                                 !  
  4. !  by CompuServe Incorporated, Columbus, Ohio                         !
  5. !                                                                     !
  6. !  The information in this software is subject to change without      !
  7. !  notice and should not be construed as a commitment by CompuServe.  !
  8. !                                                                     !
  9. !  DATAPAC Script:                                                    !
  10. !     Connect to DataPac                                              !
  11. !     Success:  returns %Success                                      !
  12. !     Failure:  saves error msg in %FailureMsg and returns %Failure   !
  13. !                                                                     !
  14. !     $Revision::   1.4      $                                        !
  15. !                                                                     !
  16. !---------------------------------------------------------------------!
  17.  
  18. show "Connecting to DataPac";
  19. Tries = 5;
  20. on cancel goto Return_Cancel;
  21.  
  22. Wait_DataPac:
  23.  
  24.     if Tries = 0 goto DataPac_Failure;
  25.     Tries = Tries - 1;
  26.  
  27.     wait
  28.         "Connected"  goto Return_Success,
  29.         "Invalid"    goto Wait_DataPac,          ! Try again.
  30.         "DataPac"    goto Send_DataPac_Host
  31.     until 15;
  32.  
  33.     send "..." & %CR;
  34.     goto Wait_DataPac;
  35.  
  36. Send_DataPac_Host:
  37.  
  38.     wait until 10;
  39.     send "P 29400138" & %CR;
  40.  
  41. Wait_For_Connect:       ! Second wait loop will not match DataPac.
  42.  
  43.     if Tries = 0 goto DataPac_Failure;
  44.     Tries = Tries - 1;
  45.  
  46.     wait
  47.         "Connected"  goto Return_Success,
  48.         "Invalid"    goto Wait_For_Connect    ! Try again.
  49.     until 30;
  50.  
  51.     send "..." & %CR;
  52.     goto Wait_DataPac;
  53.  
  54. DataPac_Failure:
  55.     define %FailureMsg = "DataPac is not responding";
  56.     exit %Failure;
  57.  
  58. Return_Cancel:
  59.     exit %Cancel;
  60.  
  61. Return_Success:
  62.     exit %Success;
  63.