home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1997 October / DPCB1097.iso / internet / CSI303UK / SCRIPTS.LIB / DATEXJ.SCR < prev    next >
Text File  |  1997-01-30  |  2KB  |  111 lines

  1. !
  2. !  Copyright (c) 1997
  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. !  Datex-J (BTX):
  9. !    Success:  returns %Success
  10. !    Failure:  saves error msg in %FailureMsg and returns %Failure
  11. !
  12. !+V
  13. ! "4.0"
  14. !-V
  15.  
  16. Tries = 5;
  17. count = 6;
  18. Second_Time = %FALSE;
  19. on cancel goto Return_Cancel;
  20. show "Connecting to Datex-J";
  21.  
  22. Resend_Response:
  23.     wait until 10;
  24.     send "." & %CR;    
  25.  
  26. Wait_DatexJ:
  27.     if Tries = 0 goto DatexJ_Failure;
  28.     Tries = Tries - 1;
  29.     wait
  30.         "CET"        goto Send_Response,
  31.         "AA"        goto Send_Response,
  32.         "000000"    goto Send_Kennung,
  33.  
  34.         %mdm_Failure    goto DatexJ_Failure
  35.     until 200;
  36.  
  37. Send_Response: 
  38.     wait until 10;
  39.     send "." & %CR;
  40.  
  41. Wait_Kennung:
  42.     wait
  43.         "000000"    goto Send_Kennung
  44.     until 200;
  45.  
  46. Send_Kennung:
  47.     wait until 10;
  48.     send "000327278259";
  49.         show "Sending Datex-J User ID";
  50.  
  51.  
  52. Wait_Connect:
  53.     if count = 0 goto DatexJ_Failure;
  54.     count = count - 1;
  55.     wait    
  56.         "sicht"        goto Send_CR,
  57.         "aufbau mit"    goto Send_CR,
  58.         "gabeseite"    goto Send_11,
  59.         "Host Name:"    goto Match_Host_Name,
  60.         "User ID:"    goto Match_Host_Name,
  61.         %mdm_Failure    goto DatexJ_Failure
  62.  
  63.     until 300;
  64.     
  65.     if Second_Time = %TRUE goto Send_11;
  66.     Second_Time = %TRUE;
  67.     goto Send_CR;
  68.  
  69.  
  70. Send_CR:
  71.     wait
  72.         %mdm_Failure    goto DatexJ_Failure,
  73.         "User ID:"    goto Match_Host_Name,
  74.         "Host Name:"    goto Match_Host_Name
  75.     until 10;
  76.     
  77.     send %CR;
  78.  
  79.     goto Wait_Connect;
  80.  
  81.  
  82. Send_11:
  83.     wait
  84.         %mdm_Failure    goto DatexJ_Failure,
  85.         "User ID:"    goto Match_Host_Name,
  86.         "Host Name:"    goto Match_Host_Name
  87.     until 10;
  88.     
  89.     Second_Time = %FALSE;
  90.     send "11";
  91.  
  92.     goto Wait_Connect;
  93.  
  94.  
  95. DatexJ_Failure:
  96.         define %FailureMsg = "Datex-J not responding";
  97.     exit %Failure;
  98.  
  99. Return_Cancel:
  100.     exit %Cancel;
  101.  
  102. Match_Host_Name:
  103.     wait
  104.         "Host Name:"    goto Match_Host_Name
  105.     until 10;
  106.  
  107. Return_Success:
  108.     send %CR;
  109.     wait until 10;
  110.     exit %Success;
  111.