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