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 / CONNECT.SCR < prev    next >
Text File  |  1993-02-05  |  8KB  |  283 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. !     Connect Script:                                                 !
  10. !                                                                     !
  11. !     Handles CompuServe and Direct.                                  !
  12. !                                                                     !
  13. !     $Revision::   1.27    $                                         !
  14. !                                                                     !
  15. !---------------------------------------------------------------------!
  16. ! NOTE:  It is recommended that the numeric codes for networks NOT be
  17. !        modified since other utility programs may assume the relationships
  18. !        of network names and network ids specified below.
  19.  
  20. !+N
  21. CompuServe = 1;         ! "CompuServe"
  22. Telenet = 2;            ! "SprintNet"
  23. Tymnet = 3;             ! "Tymnet"
  24. DataPac = 4;            ! "DataPac"
  25. InfoNet_Europe = 5;     ! "InfoNet-Euro"
  26. InfoNet_World = 6;      ! "InfoNet-Wrld"
  27. LATA = 7;               ! "LATA"
  28. CTLATA = 8;             ! "LATA-Ct"
  29. Telepac = 9;            ! "Telepac"
  30. Datex_P = 10;           ! "Datex-P"
  31. Dialplus = 11;          ! "GNS Dialplus"
  32. NIF = 12;               ! "NIFTY LL"
  33. CompuPass = 13;         ! "CompuPass"
  34. FALNET = 14;            ! "FALNET"
  35. Mercury = 15;           ! "Mercury"
  36. CSIRnet = 16;           ! "CSIR-Net"
  37. ISRAKAV = 17;           ! "ISRAKAV"
  38. Transpac = 18;          ! "Transpac"
  39. Direct = 19;            ! "Direct"
  40. !-N
  41.  
  42. define %CR = "^M";
  43. define %FALSE = 0;
  44. define %TRUE = 1;
  45. hangup = 1;
  46. UsingModem = %FALSE;
  47. CISNetwork = %FALSE;
  48.  
  49. !------------------------!
  50. !     Main Program       !
  51. !------------------------!
  52.  
  53.     init %Port, %BaudRate;
  54.     if %_init goto Continue_Connect;
  55.  
  56.     define %FailureMsg = "Could not initialize port";
  57.     goto Connect_Fatal;
  58.  
  59. Continue_Connect:
  60.     call %Dir & "first.scr" () : Result;
  61.     if Result = %Cancel goto Cancel_Connect;
  62.     if Result = %Failure goto Connect_Failure;
  63.     if Result = %Fatal goto Connect_Fatal;
  64.  
  65.     on cancel goto Cancel_Connect;
  66.     DirectConnect = (%Network = Direct);
  67.     if DirectConnect goto Connect_CIS;
  68.  
  69.     call %Dir & "phone.scr" () : Result;
  70.  
  71.     if Result = %Cancel goto Cancel_Connect;
  72.     if Result = %Failure goto Connect_Failure;
  73.     if Result = %Fatal goto Connect_Fatal;
  74.  
  75.     UsingModem = %TRUE;
  76.  
  77.     if %Network = CompuServe goto Connect_CIS;
  78.     if %Network = Telenet goto Connect_Telenet;
  79.     if %Network = Tymnet goto Connect_Tymnet;
  80.     if %Network = DataPac goto Connect_DataPac;
  81.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  82.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  83.     if %Network = LATA goto Connect_LATA;
  84.     if %Network = CTLATA goto Connect_CTLATA;
  85.     if %Network = Telepac goto Connect_Telepac;
  86.     if %Network = Datex_P goto Connect_Datex_P;
  87.     if %Network = Dialplus goto Connect_Dialplus;
  88.     if %Network = NIF goto Connect_NIF;
  89.     if %Network = CompuPass goto Connect_CompuPass;
  90.     if %Network = FALNET goto Connect_FALNET;
  91.     if %Network = Mercury goto Connect_Mercury;
  92.     if %Network = CSIRnet goto Connect_CSIRnet;
  93.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  94.     if %Network = Transpac goto Connect_Transpac;
  95.  
  96.     define %FailureMsg = "Network not supported";
  97.     goto Connect_Fatal;
  98.  
  99. !----------------------!
  100. !  Connect to Telenet  !
  101. !----------------------!
  102.  
  103. Connect_Telenet:
  104.     call %Dir & "telenet.scr" () : Result;
  105.     goto Handle_Network_Return;
  106.  
  107. !----------------------!
  108. !  Connect to Tymnet   !
  109. !----------------------!
  110.  
  111. Connect_Tymnet:
  112.     call %Dir & "tymnet.scr" () : Result;
  113.     goto Handle_Network_Return;
  114.  
  115. !----------------------!
  116. !  Connect to DataPac  !
  117. !----------------------!
  118.  
  119. Connect_DataPac:
  120.     call %Dir & "datapac.scr" () : Result;
  121.     goto Handle_Network_Return;
  122.  
  123. !-----------------------------!
  124. !  Connect to InfoNet Europe  !
  125. !-----------------------------!
  126.  
  127. Connect_InfoNet_Europe:
  128.     call %Dir & "infonet.scr" (%TRUE) : Result;
  129.     goto Handle_Network_Return;
  130.  
  131. !---------------------------!
  132. !  Connect to InfoNet World !
  133. !---------------------------!
  134.  
  135. Connect_InfoNet_World:
  136.     call %Dir & "infonet.scr" (%FALSE) : Result;
  137.     goto Handle_Network_Return;
  138.  
  139. !----------------------!
  140. !  Connect to LATA     !
  141. !----------------------!
  142.  
  143. Connect_LATA:
  144.     call %Dir & "lata.scr" (%TRUE) : Result;
  145.     goto Handle_Network_Return;
  146.  
  147. !------------------------------!
  148. !  Connect to Connecticut LATA !
  149. !------------------------------!
  150.  
  151. Connect_CTLATA:
  152.     call %Dir & "lata.scr" (%FALSE) : Result;
  153.     goto Handle_Network_Return;
  154.  
  155. !----------------------!
  156. !  Connect to Telepac  !
  157. !----------------------!
  158.  
  159. Connect_Telepac:
  160.     call %Dir & "telepac.scr" () : Result;
  161.     goto Handle_Network_Return;
  162.  
  163. !----------------------!
  164. !  Connect to Datex-P  !
  165. !----------------------!
  166.  
  167. Connect_Datex_P:
  168.     call %Dir & "datexp.scr" () : Result;
  169.     goto Handle_Network_Return;
  170.  
  171. !----------------------!
  172. !  Connect to Dialplus !
  173. !----------------------!
  174.  
  175. Connect_Dialplus:
  176.     call %Dir & "dialplus.scr" () : Result;
  177.     goto Handle_Network_Return;
  178.  
  179. !------------------!
  180. !  Connect to NIF  !
  181. !------------------!
  182.  
  183. Connect_NIF:
  184.     call %Dir & "fenics.scr" (%TRUE) : Result;
  185.     goto Handle_Network_Return;
  186.  
  187. !------------------------!
  188. !  Connect to CompuPass  !
  189. !------------------------!
  190.  
  191. Connect_CompuPass:
  192.     call %Dir & "fenics.scr" (%FALSE) : Result;
  193.     goto Handle_Network_Return;
  194.  
  195. !------------------------!
  196. !  Connect to FALNET     !
  197. !------------------------!
  198.  
  199. Connect_FALNET:
  200.     call %Dir & "falnet.scr" (%FALSE) : Result;
  201.     goto Handle_Network_Return;
  202.  
  203. !------------------------!
  204. !  Connect to Mercury    !
  205. !------------------------!
  206.  
  207. Connect_Mercury:
  208.     call %Dir & "mercury.scr" () : Result;
  209.     goto Handle_Network_Return;
  210.  
  211. !------------------------!
  212. !  Connect to CSIR-Net   !
  213. !------------------------!
  214.  
  215. Connect_CSIRnet:
  216.     call %Dir & "csirnet.scr" () : Result;
  217.     goto Handle_Network_Return;
  218.  
  219. !------------------------!
  220. !  Connect to ISRAKAV    !
  221. !------------------------!
  222.  
  223. Connect_ISRAKAV:
  224.     call %Dir & "israkav.scr" () : Result;
  225.     goto Handle_Network_Return;
  226.  
  227. !------------------------!
  228. !  Connect to Transpac   !
  229. !------------------------!
  230.  
  231. Connect_Transpac:
  232.     call %Dir & "transpac.scr" () : Result;
  233.     goto Handle_Network_Return;
  234.  
  235. !-------------------------!
  236. !  Handle Network Return  !
  237. !-------------------------!
  238.  
  239. Handle_Network_Return:
  240.     if Result = %Success goto Do_CIS_Script;
  241.     if Result = %Cancel goto Cancel_Connect;
  242.     if Result = %Fatal goto Connect_Fatal;
  243.     goto Connect_Failure;
  244.  
  245. !-------------------!
  246. !  Connect to CIS   !
  247. !-------------------!
  248.  
  249. Connect_CIS:
  250.     CISNetwork = %TRUE;
  251.     send %CR;
  252.  
  253. Do_CIS_Script:
  254.     call %Dir & "cserve.scr" (DirectConnect, CISNetwork) : Result;
  255.     if Result = %Failure goto Connect_Failure;
  256.     if Result = %Cancel goto Cancel_Connect;
  257.     if Result = %Fatal goto Connect_Fatal;
  258.     exit %Success;
  259.  
  260. Connect_Failure:
  261.     gosub Hangup_Connect;
  262.     reset;
  263.     exit %Failure;
  264.  
  265. Connect_Fatal:
  266.     gosub Hangup_Connect;
  267.     reset;
  268.     exit %Fatal;
  269.  
  270. Hangup_Connect:
  271.     if not UsingModem goto Hangup_Done;
  272.     ifndef %LOCAL = 1;
  273.     call %Dir & "disconct.scr" ();
  274.  
  275. Hangup_Done:
  276.     return;
  277.  
  278. Cancel_Connect:
  279.     show "Connect cancelled";
  280.     gosub Hangup_Connect;
  281.     reset;
  282.     exit %Cancel;
  283.