home *** CD-ROM | disk | FTP | other *** search
/ Curio City 9 / CURIO9.bin / pc / internet / win / w95nim / program / data.z / CONNECT.SCR < prev    next >
Text File  |  1997-09-10  |  6KB  |  238 lines

  1. %ShowdEnable = 1;
  2. !
  3. !  Copyright (c) 1996
  4. !  by NIFTY Corporation, Tokyo, Japan
  5. !  by CompuServe Incorporated, Columbus, Ohio
  6. !
  7. !  The information in this software is subject to change without
  8. !  notice and should not be construed as a commitment by CompuServe.
  9. !
  10. !  CONNECT:
  11. !    Handles NIFTY SERVE and Direct.
  12. !
  13. !  NOTE:  It is recommended that the numeric codes for networks NOT be
  14. !    modified since other utility programs may assume the relationships
  15. !    of network names and network ids specified below.
  16. !
  17. !+V
  18. ! "3.5"
  19. !-V
  20.  
  21. !+N
  22. CompuServe = 1;        ! "SCSERVE.SCR"
  23. FENICS_II = 42;        ! "SFENICS2.SCR"
  24. FENICS_IV = 43;        ! "SFENICS4.SCR"
  25. FENICS_V = 47;        ! "SFENICS5.SCR"
  26. NIFTY_VII = 51;        ! "SNROAD7.SCR"
  27. INS-C = 44;            ! "SINSC.SCR"
  28. MNP10 = 46;            ! "SMNP10.SCR"
  29. DOCOMO = 49;        ! "SDOCOMO.SCR"
  30. FENICS2.SCR = 42;    ! "SFENICS2.SCR"
  31. FENICS4.SCR = 43;    ! "SFENICS4.SCR"
  32. FENICS5.SCR = 47;    ! "SFENICS5.SCR"
  33. NIFROAD7.SCR = 51;    ! "SNROAD7.SCR"
  34. INSC.SCR = 44;        ! "SINSC.SCR"
  35. MNP10.SCR = 46;        ! "SMNP10.SCR"
  36. DOCOMO.SCR = 49;    ! "SDOCOMO.SCR"
  37. Infonet = 50;        ! "SINFONET.SCR"
  38. InfoNet-Euro = 5;    ! "SINFONET.SCR"
  39. InfoNet-Kor = 29;    ! "SINFONET.SCR"
  40. InfoNet-Mex = 31;    ! "SINFONET.SCR"
  41. InfoNet-RSA = 32;    ! "SINFONET.SCR"
  42. InfoNet-Taiw = 30;    ! "SINFONET.SCR"
  43. !-N
  44.  
  45. define %CR  = "^M";
  46. define %ENQ = "^E";
  47. define %ACK = "^F";
  48. define %NAK = "^U";
  49. define %XOFF = "^Q";
  50. define %FALSE = 0;
  51. define %TRUE = 1;
  52. define %ErrorCode = 0;
  53. hangup = 1;
  54. UsingModem = %FALSE;
  55. NIFNetwork = %FALSE;
  56.  
  57. !
  58. ! Main Program
  59. !
  60.  
  61. Connect_Network:
  62.     if %Network = FENICS_II goto Connect_FENICS_II;
  63.     if %Network = FENICS2.SCR goto Connect_FENICS_II;
  64.     if %Network = FENICS_IV goto Connect_FENICS_IV;
  65.     if %Network = FENICS4.SCR goto Connect_FENICS_IV;
  66.     if %Network = FENICS_V goto Connect_FENICS_V;
  67.     if %Network = FENICS5.SCR goto Connect_FENICS_V;
  68.     if %Network = FENICS_VII goto Connect_FENICS_VII;
  69.     if %Network = NIFROAD7.SCR goto Connect_NIFTY_VII;
  70.     if %Network = INS-C goto Connect_INS-C;
  71.     if %Network = INS-C.SCR goto Connect_INS-C;
  72.     if %Network = MNP10 goto Connect_MNP10;
  73.     if %Network = MNP10.SCR goto Connect_MNP10;
  74.     if %Network = DOCOMO goto Connect_DOCOMO;
  75.     if %Network = DOCOMO.SCR goto Connect_DOCOMO;
  76.     if %Network = CompuServe goto Connect_CIS;
  77.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  78.     if %Network = InfoNet_Korea goto Connect_InfoNet_Korea;
  79.     if %Network = InfoNet_Taiwan goto Connect_InfoNet_Taiwan;
  80.     if %Network = InfoNet_Mexico goto Connect_InfoNet_Mexico;
  81.     if %Network = InfoNet_SAfrica goto Connect_InfoNet_SAfrica;
  82.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  83.     if %Network = Infonet goto Connect_InfoNet;
  84.  
  85.     define %FailureMsg = "Network not supported";
  86.     goto Connect_Fatal;
  87.  
  88. !
  89. !  Connect to InfoNet
  90. !
  91. Connect_InfoNet:
  92.     call %Dir & "sinfonet.scr" (0) : Result;
  93.     goto Handle_Network_Return;
  94.  
  95. !
  96. !  Connect to InfoNet World
  97. !
  98. Connect_InfoNet_World:
  99.     call %Dir & "sinfonet.scr" (0) : Result;
  100.     goto Handle_Network_Return;
  101.  
  102. !
  103. !  Connect to InfoNet Europe
  104. !
  105. Connect_InfoNet_Europe:
  106.     call %Dir & "sinfonet.scr" (1) : Result;
  107.     goto Handle_Network_Return;
  108.  
  109. !
  110. !  Connect to InfoNet Korea
  111. !
  112. Connect_InfoNet_Korea:
  113.     call %Dir & "sinfonet.scr" (2) : Result;
  114.     goto Handle_Network_Return;
  115.  
  116. !
  117. !  Connect to InfoNet Taiwan
  118. !
  119. Connect_InfoNet_Taiwan:
  120.     call %Dir & "sinfonet.scr" (3) : Result;
  121.     goto Handle_Network_Return;
  122.  
  123. !
  124. !  Connect to InfoNet Mexico
  125. !
  126. Connect_InfoNet_Mexico:
  127.     call %Dir & "sinfonet.scr" (4) : Result;
  128.     goto Handle_Network_Return;
  129.  
  130. !
  131. !  Connect to InfoNet South Africa
  132. !
  133. Connect_InfoNet_SAfrica:
  134.     call %Dir & "sinfonet.scr" (5) : Result;
  135.     goto Handle_Network_Return;
  136.  
  137. !
  138. !  Connect to FENICS II
  139. !
  140.  
  141. Connect_FENICS_II:
  142.     call %Dir & "sfenics2.scr" (3) : Result;
  143.     goto Handle_Network_Return;
  144.  
  145. Connect_FENICS_IV:
  146.     call %Dir & "sfenics4.scr" (3) : Result;
  147.     goto Handle_Network_Return;
  148.  
  149. Connect_FENICS_V:
  150.     call %Dir & "sfenics5.scr" (3) : Result;
  151.     goto Handle_Network_Return;
  152.  
  153. Connect_NIFTY_VII:
  154.     call %Dir & "snroad7.scr" (3) : Result;
  155.     goto Handle_Network_Return;
  156.  
  157. Connect_INS-C:
  158.     call %Dir & "sinsc.scr" (3) : Result;
  159.     goto Handle_Network_Return;
  160.  
  161. Connect_MNP10:
  162.     call %Dir & "smnp10.scr" (3) : Result;
  163.     goto Handle_Network_Return;
  164.  
  165. Connect_DOCOMO:
  166.     call %Dir & "sdocomo.scr" (3) : Result;
  167.     goto Handle_Network_Return;
  168.  
  169. Connect_CIS:
  170.     call %Dir & "scserve.scr" (3) : Result;
  171.     goto Handle_Network_Return;
  172.  
  173. !
  174. !  Handle Network Return
  175. !
  176. Handle_Network_Return:
  177.     if Result = %Success goto Do_NIF_Script;
  178.     if Result = %Cancel goto Cancel_Connect;
  179.     if Result = %Fatal goto Connect_Fatal;
  180.     if Result = %ErrorCode goto Connect_Error;
  181.     goto Connect_Failure;
  182.  
  183. !
  184. !  Connect to NIF
  185. !
  186. Connect_NIF:
  187.     NIFNetwork = %TRUE;
  188.     send %CR;
  189.  
  190. Do_NIF_Script:
  191.     guide "Connect Successful";
  192.     reset;
  193.     exit %Success;
  194.  
  195. Connect_Failure:
  196.     guide %FailureMsg;
  197.     gosub Hangup_Connect;
  198.     reset;
  199.     exit %Failure;
  200.  
  201. Connect_Fatal:
  202.     guide "Connect Fatal";
  203.     gosub Hangup_Connect;
  204.     reset;
  205.     guide "Connect Fatal";
  206.     exit %Fatal;
  207.  
  208. Hangup_Connect:
  209.     if not UsingModem goto Hangup_Done;
  210.     define %LOCAL = 1;
  211. Hangup_Done:
  212.     return;
  213.  
  214. Cancel_Connect:
  215.     guide "Connect cancelled";
  216.     gosub Hangup_Connect;
  217.     reset;
  218.     exit %Cancel;
  219.  
  220. Init_Fatal:
  221.     guide "Could not initialize port";
  222.     gosub Hangup_Connect;
  223.     reset;
  224.     exit %_init;
  225.  
  226. Init_TimeOut:
  227.     guide "タイムアウト";
  228.     gosub Hangup_Connect;
  229.     reset;
  230.     %ErrorCode = 1008;
  231.     exit %ErrorCode;
  232.  
  233. Connect_Error:
  234.     guide %FailureMsg;
  235.     gosub Hangup_Connect;
  236.     reset;
  237.     exit %ErrorCode;
  238.