home *** CD-ROM | disk | FTP | other *** search
/ PC go! 1995 July / Image.iso / pcgo / programm / online / compserv / cserve / scripts / connect.old < prev    next >
Encoding:
Text File  |  1994-07-06  |  7.3 KB  |  338 lines

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