home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1996 May / buyer-0596.iso / wincim / scripts.lib / CONNECT.SCR < prev    next >
Text File  |  1995-12-05  |  9KB  |  390 lines

  1. !
  2. !  Copyright (c) 1995
  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.8.1"
  17. !-V
  18.  
  19. !+N
  20. CompuServe = 1;        ! "CompuServe"
  21. AlaskaNet = 36;         ! "AlaskaNet"
  22. Chilepac= 28;        ! "Chilepac"
  23. CSIRnet = 16;        ! "CSIR-Net"
  24. DataPac = 4;        ! "DataPac"
  25. Datex_J = 19;        ! "Datex-J"
  26. Datex_P = 10;        ! "Datex-P"
  27. EIRPAC = 33;            ! "EIRPAC"
  28. FENICSII = 24;        ! "FENICS II"
  29. FTConnect = 12;         ! "FT-Connect"
  30. Dialplus = 11;        ! "GNS Dialplus"
  31. InfoNet_Europe = 5;    ! "InfoNet-Euro"
  32. InfoNet_Korea = 29;    ! "InfoNet-Kor"
  33. InfoNet_Mexico = 31;    ! "InfoNet-Mex"
  34. InfoNet_SAfrica = 32;    ! "InfoNet-RSA"
  35. InfoNet_Taiwan = 30;    ! "InfoNet-Taiw"
  36. InfoNet_World = 6;    ! "InfoNet-Wrld"
  37. Internet = 25;        ! "Internet"
  38. ISRAKAV = 17;        ! "ISRAKAV"
  39. LATA = 7;        ! "LATA"
  40. CTLATA = 8;        ! "LATA-Ct"
  41. Mercury = 15;        ! "Mercury"
  42. PacNet = 21;        ! "PacNet"
  43. PosServe = 27;        ! "Pos-Serve LL"
  44. SCITOR = 34;            ! "SCITOR"
  45. SEVA = 35;              ! "SEVA"
  46. Telenet = 2;        ! "SprintNet"
  47. Telepac = 9;        ! "Telepac"
  48. Transpac = 18;        ! "Transpac"
  49. TTNNet = 22;        ! "TTN-Net"
  50. Tymnet = 3;        ! "Tymnet"
  51. VNZNET = 23;        ! "VNZ-Net"
  52. Direct = 40;    ! "Direct"
  53. !-N
  54.  
  55. define %CR = "^M";
  56. define %FALSE = 0;
  57. define %TRUE = 1;
  58. define %ErrorCode = 0;
  59. define %PPP = "";
  60. hangup = 1;
  61. UsingModem = %FALSE;
  62. CISNetwork = %FALSE;
  63. ifndef %App = "";
  64. if (%App = "CID") and (%Network = Internet) goto Dialer;
  65.  
  66. Initialize:
  67. !
  68. ! Main Program
  69. !
  70. init %Port, %BaudRate;
  71. if %_init goto Continue_Connect;
  72.  
  73. define %FailureMsg = "Could not initialize port";
  74. define %ErrorCode = 2;
  75. if %Network <> Internet goto Connect_Fatal;
  76. define %ErrorCode = 3;
  77. goto Connect_Fatal;
  78.  
  79. Dialer:
  80. define %Network = CompuServe;
  81. goto Initialize;
  82.  
  83. Continue_Connect:
  84.     call %Dir & "first.scr" () : Result;
  85.     if Result = %Cancel goto Cancel_Connect;
  86.     if Result = %Failure goto Connect_Failure;
  87.     if Result = %Fatal goto Connect_Fatal;
  88.  
  89.     on cancel goto Cancel_Connect;
  90.     DirectConnect = (%Network = Direct) or (%DialType = 2);
  91.  
  92.     if DirectConnect goto Connect_Network;
  93.  
  94.     call %Dir & "phone.scr" () : Result;
  95.  
  96.     if Result = %Cancel goto Cancel_Connect;
  97.     if Result = %Failure goto Connect_Failure;
  98.     if Result = %Fatal goto Connect_Fatal;
  99.     UsingModem = %TRUE;
  100.  
  101. Connect_Network:
  102.     if %Network = CompuServe goto Connect_CIS;
  103.     if %Network = Direct goto Connect_CIS;
  104.     if %Network = Telenet goto Connect_Telenet;
  105.     if %Network = Tymnet goto Connect_Tymnet;
  106.     if %Network = DataPac goto Connect_DataPac;
  107.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  108.     if %Network = InfoNet_Korea goto Connect_InfoNet_Korea;
  109.     if %Network = InfoNet_Taiwan goto Connect_InfoNet_Taiwan;
  110.     if %Network = InfoNet_Mexico goto Connect_InfoNet_Mexico;
  111.     if %Network = InfoNet_SAfrica goto Connect_InfoNet_SAfrica;
  112.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  113.     if %Network = Internet goto Connect_CIS;
  114.     if %Network = LATA goto Connect_LATA;
  115.     if %Network = CTLATA goto Connect_CTLATA;
  116.     if %Network = Telepac goto Connect_Telepac;
  117.     if %Network = Datex_P goto Connect_Datex_P;
  118.     if %Network = Datex_J goto Connect_Datex_J;
  119.     if %Network = Dialplus goto Connect_Dialplus;
  120.     if %Network = Mercury goto Connect_Mercury;
  121.     if %Network = CSIRnet goto Connect_CSIRnet;
  122.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  123.     if %Network = Transpac goto Connect_Transpac;
  124.     if %Network = PacNet goto Connect_PacNet;
  125.     if %Network = PosServe goto Connect_PosServe;
  126.     if %Network = TTNNet goto Connect_TTNNet;
  127.     if %Network = FENICSII goto Connect_FENICSII;
  128.     if %Network = VNZNET goto Connect_CIS;
  129.     if %Network = Chilepac goto Connect_Chilepac;
  130.         if %Network = EIRPAC goto Connect_EIRPAC;
  131.         if %Network = SCITOR goto Connect_SCITOR;
  132.         if %Network = SEVA goto Connect_SEVA;
  133.         if %Network = AlaskaNet goto Connect_AlaskaNet;
  134.         if %Network = FTConnect goto Connect_FTConnect;
  135.  
  136.     define %FailureMsg = "Network not supported";
  137.     goto Connect_Fatal;
  138.  
  139. !
  140. !  Connect to Telenet
  141. !
  142. Connect_Telenet:
  143.     call %Dir & "telenet.scr" () : Result;
  144.     goto Handle_Network_Return;
  145.  
  146. !
  147. !  Connect to Tymnet
  148. !
  149. Connect_Tymnet:
  150.     call %Dir & "tymnet.scr" (1) : Result;
  151.     goto Handle_Network_Return;
  152.  
  153. !
  154. !  Connect to DataPac
  155. !
  156. Connect_DataPac:
  157.     call %Dir & "datapac.scr" () : Result;
  158.     goto Handle_Network_Return;
  159.  
  160. !
  161. !  Connect to InfoNet World
  162. !
  163. Connect_InfoNet_World:
  164.     call %Dir & "infonet.scr" (0) : Result;
  165.     goto Handle_Network_Return;
  166.  
  167. !
  168. !  Connect to InfoNet Europe
  169. !
  170. Connect_InfoNet_Europe:
  171.     call %Dir & "infonet.scr" (1) : Result;
  172.     goto Handle_Network_Return;
  173.  
  174. !
  175. !  Connect to InfoNet Korea
  176. !
  177. Connect_InfoNet_Korea:
  178.     call %Dir & "infonet.scr" (2) : Result;
  179.     goto Handle_Network_Return;
  180.  
  181. !
  182. !  Connect to InfoNet Taiwan
  183. !
  184. Connect_InfoNet_Taiwan:
  185.     call %Dir & "infonet.scr" (3) : Result;
  186.     goto Handle_Network_Return;
  187.  
  188. !
  189. !  Connect to InfoNet Mexico
  190. !
  191. Connect_InfoNet_Mexico:
  192.     call %Dir & "infonet.scr" (4) : Result;
  193.     goto Handle_Network_Return;
  194.  
  195. !
  196. !  Connect to InfoNet South Africa
  197. !
  198. Connect_InfoNet_SAfrica:
  199.     call %Dir & "infonet.scr" (5) : Result;
  200.     goto Handle_Network_Return;
  201.  
  202. !
  203. !  Connect to LATA
  204. !
  205. Connect_LATA:
  206.     call %Dir & "lata.scr" (%TRUE) : Result;
  207.     goto Handle_Network_Return;
  208.  
  209. !
  210. !  Connect to Connecticut LATA
  211. !
  212. Connect_CTLATA:
  213.     call %Dir & "lata.scr" (%FALSE) : Result;
  214.     goto Handle_Network_Return;
  215.  
  216. !
  217. !  Connect to Telepac
  218. !
  219. Connect_Telepac:
  220.     call %Dir & "telepac.scr" () : Result;
  221.     goto Handle_Network_Return;
  222.  
  223. !
  224. !  Connect to Datex-P
  225. !
  226. Connect_Datex_P:
  227.     call %Dir & "datexp.scr" () : Result;
  228.     goto Handle_Network_Return;
  229.  
  230. !
  231. !  Connect to Datex-J
  232. !
  233. Connect_Datex_J:
  234.     call %Dir & "datexj.scr" () : Result;
  235.     goto Handle_Network_Return;
  236.  
  237. !
  238. !  Connect to Dialplus
  239. !
  240. Connect_Dialplus:
  241.     call %Dir & "dialplus.scr" () : Result;
  242.     goto Handle_Network_Return;
  243.  
  244. !
  245. !  Connect to FT-Connect
  246. !
  247. Connect_FTConnect:
  248.         call %Dir & "ftconn.scr" () : Result;
  249.     goto Handle_Network_Return;
  250.  
  251. !
  252. !  Connect to Mercury
  253. !
  254. Connect_Mercury:
  255.     call %Dir & "mercury.scr" () : Result;
  256.     goto Handle_Network_Return;
  257.  
  258. !
  259. !  Connect to CSIR-Net
  260. !
  261. Connect_CSIRnet:
  262.     call %Dir & "csirnet.scr" () : Result;
  263.     goto Handle_Network_Return;
  264.  
  265. !
  266. !  Connect to ISRAKAV
  267. !
  268. Connect_ISRAKAV:
  269.     call %Dir & "israkav.scr" () : Result;
  270.     goto Handle_Network_Return;
  271.  
  272. !
  273. !  Connect to Transpac
  274. !
  275. Connect_Transpac:
  276.     call %Dir & "transpac.scr" () : Result;
  277.     goto Handle_Network_Return;
  278.  
  279. !
  280. !  Connect to AlaskaNet
  281. !
  282. Connect_AlaskaNet:
  283.     call %Dir & "tymnet.scr" (2) : Result;
  284.     goto Handle_Network_Return;
  285.  
  286. !
  287. !  Connect to PacNet
  288. !
  289. Connect_PacNet:
  290.     call %Dir & "tymnet.scr" (3) : Result;
  291.     goto Handle_Network_Return;
  292.  
  293.     
  294. !
  295. !  Connect to Pos-Serve
  296. !
  297. Connect_PosServe:
  298.     call %Dir & "posserve.scr" () : Result;
  299.     goto Handle_Network_Return;
  300.  
  301. !
  302. !  Connect to TTN-Net
  303. !
  304. Connect_TTNNet:
  305.     call %Dir & "ttnnet.scr" (3) : Result;
  306.     goto Handle_Network_Return;
  307.  
  308. !
  309. !  Connect to FENICS II
  310. !
  311. Connect_FENICSII:
  312.     call %Dir & "fenics2.scr" (3) : Result;
  313.     goto Handle_Network_Return;
  314.  
  315. !
  316. !  Connect to Chilepac
  317. !
  318. Connect_Chilepac:
  319.     call %Dir & "chilepac.scr" (3) : Result;
  320.     goto Handle_Network_Return;
  321.  
  322. !
  323. !  Connect to EIRPAC
  324. !
  325. Connect_EIRPAC:
  326.         call %Dir & "eirpac.scr" () : Result;
  327.     goto Handle_Network_Return;
  328.  
  329. !
  330. !  Connect to SCITOR
  331. !
  332. Connect_SCITOR:
  333.         call %Dir & "scitor.scr" () : Result;
  334.     goto Handle_Network_Return;
  335.  
  336. !
  337. !  Connect to SEVA
  338. !
  339. Connect_SEVA:
  340.         call %Dir & "seva.scr" () : Result;
  341.     goto Handle_Network_Return;
  342.  
  343.  
  344. !
  345. !  Handle Network Return
  346. !
  347. Handle_Network_Return:
  348.     if Result = %Success goto Do_CIS_Script;
  349.     if Result = %Cancel goto Cancel_Connect;
  350.     if Result = %Fatal goto Connect_Fatal;
  351.     goto Connect_Failure;
  352.  
  353. !
  354. !  Connect to CIS
  355. !
  356. Connect_CIS:
  357.     CISNetwork = %TRUE;
  358.     send %CR;
  359.  
  360. Do_CIS_Script:
  361.     call %Dir & "cserve.scr" (DirectConnect, CISNetwork) : Result;
  362.     if Result = %Failure goto Connect_Failure;
  363.     if Result = %Cancel goto Cancel_Connect;
  364.     if Result = %Fatal goto Connect_Fatal;
  365.     exit %Success;
  366.  
  367. Connect_Failure:
  368.     gosub Hangup_Connect;
  369.     reset;
  370.     exit %Failure;
  371.  
  372. Connect_Fatal:
  373.     gosub Hangup_Connect;
  374.     reset;
  375.     exit %Fatal;
  376.  
  377. Hangup_Connect:
  378.     if not UsingModem goto Hangup_Done;
  379.     define %LOCAL = 1;
  380.     call %Dir & "disconct.scr" ();
  381. Hangup_Done:
  382.     return;
  383.  
  384. Cancel_Connect:
  385.     show "Connect cancelled";
  386.     gosub Hangup_Connect;
  387.     reset;
  388.     define %ErrorCode = 1;
  389.     exit %Cancel;
  390.