home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World Interactive 1997 February / pcwfeb97.zip / pcwfeb97 / COMPSERV / SCRIPTS.LIB / TRANSPAC.SCR < prev    next >
Text File  |  1996-01-29  |  1KB  |  66 lines

  1. !
  2. !  Copyright (c) 1996
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  Transpac:
  9. !    Connect to Transpac
  10. !    Success:  returns %Success
  11. !    Failure:  saves error msg in %FailureMsg and returns %Failure
  12. !
  13. !+V
  14. ! "3.8.2"
  15. !-V
  16.  
  17. CompuServe_NUA = "19628030";
  18. Tries = 5;
  19. twice_tried = %FALSE;
  20. on cancel goto Return_Cancel;
  21.  
  22. show "Connecting to Transpac";
  23. wait until 20;
  24. send %CR;
  25.  
  26. Wait_Transpac:
  27.     if Tries = 0 goto Transpac_Failure;
  28.     Tries = Tries - 1;
  29.  
  30.     wait
  31.         "TRANSPAC"    goto Send_Address,
  32.         "ERROR"        goto Resend_Address,
  33.         "LIB"        goto Resend_Address,
  34.         %mdm_Failure    goto Transpac_Failure,
  35.         "COM"        goto Return_Success
  36.     until 80;
  37.  
  38.     send %CR;
  39.     goto Wait_Transpac;
  40.  
  41. Resend_Address:
  42.     if twice_tried = %TRUE goto Cserve_NUA_Failure;
  43.     twice_tried = %TRUE;
  44.  
  45. Send_Address:
  46.     wait until 20;
  47.     show "Sending CompuServe NUA...";
  48.     send CompuServe_NUA & %CR;
  49.     goto Wait_Transpac;
  50.  
  51. Transpac_Failure:
  52.     define %FailureMsg = "Transpac not responding";
  53.     goto Return_Failure;
  54.  
  55. Cserve_NUA_Failure:
  56.     define %FailureMsg = "Transpac not accepting CompuServe NUA";
  57.  
  58. Return_Failure:
  59.     exit %Failure;
  60.  
  61. Return_Cancel:
  62.     exit %Cancel;
  63.  
  64. Return_Success:
  65.     exit %Success;
  66.