home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703B.ISO / terminal / niftyman / w95nim / program / data.z / CONNECT.SCR < prev    next >
Text File  |  1996-11-19  |  11KB  |  481 lines

  1. %ShowdEnable = 1;
  2. !
  3. !  Copyright (c) 1995
  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;        ! "CompuServe"
  23. FALNET = 14;        ! "FALNET"
  24. FENICS_II = 42;        ! "FENICS-ROAD 2"
  25. FENICS_IV = 43;        ! "FENICS-ROAD 4"
  26. FENICS_V = 47;        ! "FENICS-ROAD 5"
  27. INS-C = 44;        ! "FENICS-ROAD 3 INS-C"
  28. V32 = 45;        ! "FENICS-ROAD 3 V32"
  29. MNP10 = 46;        ! "FENICS-ROAD 3 MNP10"
  30. DOCOMO = 49;        ! "FENICS-ROAD 3 DOCOMO"
  31. FENICS2.SCR = 42;    ! "FENICS-ROAD 2"
  32. FENICS4.SCR = 43;    ! "FENICS-ROAD 4"
  33. FENICS5.SCR = 47;    ! "FENICS-ROAD 5"
  34. INSC.SCR = 44;        ! "FENICS-ROAD 3 INS-C"
  35. V32.SCR = 45;        ! "FENICS-ROAD 3 V32"
  36. MNP10.SCR = 46;        ! "FENICS-ROAD 3 MNP10"
  37. DOCOMO.SCR = 49;    ! "FENICS-ROAD 3 DOCOMO"
  38. Infonet = 50;        ! "Infonet"
  39.  
  40. Dialplus = 11;        ! "GNS Dialplus"
  41. InfoNet-Euro = 5;    ! "InfoNet-Euro"
  42. InfoNet-Kor = 29;    ! "InfoNet-Kor"
  43. InfoNet-Mex = 31;    ! "InfoNet-Mex"
  44. InfoNet-RSA = 32;    ! "InfoNet-RSA"
  45. InfoNet-Taiw = 30;    ! "InfoNet-Taiw"
  46. ISRAKAV = 17;        ! "ISRAKAV"
  47. Mercury = 15;        ! "Mercury"
  48. Transpac = 18;        ! "Transpac"
  49. VNZ-Net = 23;        ! "VNZ-Net"
  50. Direct = 40;        ! "Direct"
  51. !-N
  52.  
  53. define %CR  = "^M";
  54. define %ENQ = "^E";
  55. define %ACK = "^F";
  56. define %NAK = "^U";
  57. define %XOFF = "^Q";
  58. define %FALSE = 0;
  59. define %TRUE = 1;
  60. define %ErrorCode = 0;
  61. hangup = 1;
  62. UsingModem = %FALSE;
  63. NIFNetwork = %FALSE;
  64.  
  65. !
  66. ! Main Program
  67. !
  68. init %Port, %BaudRate;
  69. if %_init = 1001 goto Init_Fatal;
  70. if %_init = 1002 goto Init_Fatal;
  71. if %_init = 1003 goto Init_Fatal;
  72. if %_init = 1004 goto Init_Fatal;
  73. if %_init = 1005 goto Init_Fatal;
  74. if %_init = 1006 goto Init_Fatal;
  75. if %_init = 1007 goto Init_Fatal;
  76. if %_init = 9    goto Init_TimeOut;
  77. goto Continue_Connect;
  78. ;if %_init goto Continue_Connect;
  79.  
  80. define %FailureMsg = "Could not initialize port";
  81. define %ErrorCode = 2;
  82. define %DialType = 0;
  83. goto Connect_Fatal;
  84.  
  85. Continue_Connect:
  86.  
  87.     call %Dir & "sfirst.scr" () : Result;
  88.     if Result = %Cancel goto Cancel_Connect;
  89.     if Result = %Failure goto Connect_Failure;
  90.     if Result = %Fatal goto Connect_Fatal;
  91.  
  92.     on cancel goto Cancel_Connect;
  93.  
  94.     call %Dir & "sphone.scr" () : Result;
  95.     if Result = %Success goto Connect_Network;
  96.  
  97.     if Result = %Cancel goto Cancel_Connect;
  98.     if Result = %Failure goto Connect_Failure;
  99.     if Result = %ErrorCode goto Phone_Error;
  100.     if Result = %Fatal goto Connect_Fatal;
  101.     goto Phone_Exit;
  102. !    UsingModem = %TRUE;
  103.     
  104. Connect_Network:
  105.     if %Network = FENICS_II goto Connect_FENICS_II;
  106.     if %Network = FENICS2.SCR goto Connect_FENICS_II;
  107.     if %Network = FENICS_IV goto Connect_FENICS_IV;
  108.     if %Network = FENICS4.SCR goto Connect_FENICS_IV;
  109.     if %Network = FENICS_V goto Connect_FENICS_V;
  110.     if %Network = FENICS5.SCR goto Connect_FENICS_V;
  111.     if %Network = V32 goto Connect_V32;
  112.     if %Network = V32.SCR goto Connect_V32;
  113.     if %Network = INS-C goto Connect_INS-C;
  114.     if %Network = INS-C.SCR goto Connect_INS-C;
  115.     if %Network = MNP10 goto Connect_MNP10;
  116.     if %Network = MNP10.SCR goto Connect_MNP10;
  117.     if %Network = DOCOMO goto Connect_DOCOMO;
  118.     if %Network = DOCOMO.SCR goto Connect_DOCOMO;
  119.     if %Network = CompuServe goto Connect_CIS;
  120.     if %Network = Direct goto Connect_NIF;
  121.     if %Network = Telenet goto Connect_Telenet;
  122.     if %Network = Tymnet goto Connect_Tymnet;
  123.     if %Network = DataPac goto Connect_DataPac;
  124.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  125.     if %Network = InfoNet_Korea goto Connect_InfoNet_Korea;
  126.     if %Network = InfoNet_Taiwan goto Connect_InfoNet_Taiwan;
  127.     if %Network = InfoNet_Mexico goto Connect_InfoNet_Mexico;
  128.     if %Network = InfoNet_SAfrica goto Connect_InfoNet_SAfrica;
  129.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  130.     if %Network = Infonet goto Connect_InfoNet;
  131.     if %Network = Internet goto Connect_Internet;
  132.     if %Network = LATA goto Connect_LATA;
  133.     if %Network = CTLATA goto Connect_CTLATA;
  134.     if %Network = Telepac goto Connect_Telepac;
  135.     if %Network = Datex_P goto Connect_Datex_P;
  136.     if %Network = Hungary goto Connect_Hungary;
  137.     if %Network = Datex_J goto Connect_Datex_J;
  138.     if %Network = Dialplus goto Connect_Dialplus;
  139.     if %Network = NIF goto Connect_NIF;
  140.     if %Network = CompuPass goto Connect_CompuPass;
  141.     if %Network = FALNET goto Connect_FALNET;
  142.     if %Network = Mercury goto Connect_Mercury;
  143.     if %Network = CSIRnet goto Connect_CSIRnet;
  144.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  145.     if %Network = Transpac goto Connect_Transpac;
  146.     if %Network = PacNet goto Connect_PacNet;
  147.     if %Network = PosServe goto Connect_PosServe;
  148.     if %Network = VNZNET goto Connect_NIF;
  149.     if %Network = Chilepac goto Connect_Chilepac;
  150.  
  151.     define %FailureMsg = "Network not supported";
  152.     goto Connect_Fatal;
  153.  
  154. !
  155. !  Connect to Telenet
  156. !
  157. Connect_Telenet:
  158.     call %Dir & "stelenet.scr" () : Result;
  159.     goto Handle_Network_Return;
  160.  
  161. !
  162. !  Connect to Tymnet
  163. !
  164. Connect_Tymnet:
  165.     call %Dir & "stymnet.scr" (1) : Result;
  166.     goto Handle_Network_Return;
  167.  
  168. !
  169. !  Connect to DataPac
  170. !
  171. Connect_DataPac:
  172.     call %Dir & "sdatapac.scr" () : Result;
  173.     goto Handle_Network_Return;
  174.  
  175. !
  176. !  Connect to InfoNet
  177. !
  178. Connect_InfoNet:
  179.     call %Dir & "sinfonet.scr" (0) : Result;
  180.     goto Handle_Network_Return;
  181.  
  182. !
  183. !  Connect to InfoNet World
  184. !
  185. Connect_InfoNet_World:
  186.     call %Dir & "sinfonet.scr" (0) : Result;
  187.     goto Handle_Network_Return;
  188.  
  189. !
  190. !  Connect to InfoNet Europe
  191. !
  192. Connect_InfoNet_Europe:
  193.     call %Dir & "sinfonet.scr" (1) : Result;
  194.     goto Handle_Network_Return;
  195.  
  196. !
  197. !  Connect to InfoNet Korea
  198. !
  199. Connect_InfoNet_Korea:
  200.     call %Dir & "sinfonet.scr" (2) : Result;
  201.     goto Handle_Network_Return;
  202.  
  203. !
  204. !  Connect to InfoNet Taiwan
  205. !
  206. Connect_InfoNet_Taiwan:
  207.     call %Dir & "sinfonet.scr" (3) : Result;
  208.     goto Handle_Network_Return;
  209.  
  210. !
  211. !  Connect to InfoNet Mexico
  212. !
  213. Connect_InfoNet_Mexico:
  214.     call %Dir & "sinfonet.scr" (4) : Result;
  215.     goto Handle_Network_Return;
  216.  
  217. !
  218. !  Connect to InfoNet South Africa
  219. !
  220. Connect_InfoNet_SAfrica:
  221.     call %Dir & "sinfonet.scr" (5) : Result;
  222.     goto Handle_Network_Return;
  223.  
  224. !
  225. !  Connect to LATA
  226. !
  227. Connect_LATA:
  228.     call %Dir & "slata.scr" (%TRUE) : Result;
  229.     goto Handle_Network_Return;
  230.  
  231. !
  232. !  Connect to Connecticut LATA
  233. !
  234. Connect_CTLATA:
  235.     call %Dir & "slata.scr" (%FALSE) : Result;
  236.     goto Handle_Network_Return;
  237.  
  238. !
  239. !  Connect to Connecticut LATA
  240. !
  241. Connect_Internet:
  242.     call %Dir & "internet.scr" (%FALSE) : Result;
  243.     goto Handle_Network_Return;
  244.  
  245. !
  246. !  Connect to Telepac
  247. !
  248. Connect_Telepac:
  249.     call %Dir & "stelepac.scr" () : Result;
  250.     goto Handle_Network_Return;
  251.  
  252. !
  253. !  Connect to Datex-P
  254. !
  255. Connect_Datex_P:
  256.     call %Dir & "sdatexp.scr" () : Result;
  257.     goto Handle_Network_Return;
  258.  
  259. !
  260. !  Connect to Datex-P/Hungary
  261. !
  262. Connect_Hungary:
  263.     call %Dir & "shungary.scr" () : Result;
  264.     goto Handle_Network_Return;
  265.  
  266. !
  267. !  Connect to Datex-J
  268. !
  269. Connect_Datex_J:
  270.     call %Dir & "sdatexj.scr" () : Result;
  271.     goto Handle_Network_Return;
  272.  
  273. !
  274. !  Connect to Dialplus
  275. !
  276. Connect_Dialplus:
  277.     call %Dir & "dialplus.scr" () : Result;
  278.     goto Handle_Network_Return;
  279.  
  280. !
  281. !  Connect to NIF
  282. !
  283. Connect_NIF:
  284.     call %Dir & "sfenics.scr" (%TRUE) : Result;
  285.     goto Handle_Network_Return;
  286.  
  287. !
  288. !  Connect to CompuPass
  289. !
  290. Connect_CompuPass:
  291.     call %Dir & "sfenics.scr" (%FALSE) : Result;
  292.     goto Handle_Network_Return;
  293.  
  294. !
  295. !  Connect to FALNET
  296. !
  297. Connect_FALNET:
  298.     call %Dir & "sfalnet.scr" (%FALSE) : Result;
  299.     goto Handle_Network_Return;
  300.  
  301. !
  302. !  Connect to Mercury
  303. !
  304. Connect_Mercury:
  305.     call %Dir & "smercury.scr" () : Result;
  306.     goto Handle_Network_Return;
  307.  
  308. !
  309. !  Connect to CSIR-Net
  310. !
  311. Connect_CSIRnet:
  312.     call %Dir & "scsirnet.scr" () : Result;
  313.     goto Handle_Network_Return;
  314.  
  315. !
  316. !  Connect to ISRAKAV
  317. !
  318. Connect_ISRAKAV:
  319.     call %Dir & "sisrakav.scr" () : Result;
  320.     goto Handle_Network_Return;
  321.  
  322. !
  323. !  Connect to Transpac
  324. !
  325. Connect_Transpac:
  326.     call %Dir & "transpac.scr" () : Result;
  327.     goto Handle_Network_Return;
  328.  
  329. !
  330. !  Connect to AlaskaNet
  331. !
  332. Connect_AlaskaNet:
  333.     call %Dir & "stymnet.scr" (2) : Result;
  334.     goto Handle_Network_Return;
  335.  
  336. !
  337. !  Connect to PacNet
  338. !
  339. Connect_PacNet:
  340.     call %Dir & "stymnet.scr" (3) : Result;
  341.     goto Handle_Network_Return;
  342.  
  343.     
  344. !
  345. !  Connect to Pos-Serve
  346. !
  347. Connect_PosServe:
  348.     call %Dir & "posserve.scr" () : Result;
  349.     goto Handle_Network_Return;
  350.  
  351. !
  352. !  Connect to FENICS II
  353. !
  354.  
  355. Connect_FENICS_II:
  356.     call %Dir & "sfenics2.scr" (3) : Result;
  357.     goto Handle_Network_Return;
  358.  
  359. Connect_FENICS_IV:
  360.     call %Dir & "sfenics4.scr" (3) : Result;
  361.     goto Handle_Network_Return;
  362.  
  363. Connect_FENICS_V:
  364.     call %Dir & "sfenics5.scr" (3) : Result;
  365.     goto Handle_Network_Return;
  366.  
  367. Connect_V32:
  368.     call %Dir & "sv32.scr" (3) : Result;
  369.     goto Handle_Network_Return;
  370.  
  371. Connect_INS-C:
  372.     call %Dir & "sinsc.scr" (3) : Result;
  373.     goto Handle_Network_Return;
  374.  
  375. Connect_MNP10:
  376.     call %Dir & "smnp10.scr" (3) : Result;
  377.     goto Handle_Network_Return;
  378.  
  379. Connect_DOCOMO:
  380.     call %Dir & "sdocomo.scr" (3) : Result;
  381.     goto Handle_Network_Return;
  382.  
  383. Connect_CIS:
  384.     call %Dir & "scserve.scr" (3) : Result;
  385.     goto Handle_Network_Return;
  386.  
  387. Connect_Infonet:
  388.     call %Dir & "sinfonet.scr" (3) : Result;
  389.     goto Handle_Network_Return;
  390.  
  391. !
  392. !  Connect to Chilepac
  393. !
  394. Connect_Chilepac:
  395.     call %Dir & "chilepac.scr" (3) : Result;
  396.     goto Handle_Network_Return;
  397.  
  398. !
  399. !  Handle Network Return
  400. !
  401. Handle_Network_Return:
  402.     if Result = %Success goto Do_NIF_Script;
  403.     if Result = %Cancel goto Cancel_Connect;
  404.     if Result = %Fatal goto Connect_Fatal;
  405.     if Result = %ErrorCode goto Connect_Error;
  406.     goto Connect_Failure;
  407.  
  408. !
  409. !  Connect to NIF
  410. !
  411. Connect_NIF:
  412.     NIFNetwork = %TRUE;
  413.     send %CR;
  414.  
  415. Do_NIF_Script:
  416. !    call %Dir & "scserve.scr" (DirectConnect, NIFNetwork) : Result;
  417. !    if Result = %Failure goto Connect_Failure;
  418. !    if Result = %Cancel goto Cancel_Connect;
  419. !    if Result = %Fatal goto Connect_Fatal;
  420.     guide "Connect Successful";
  421.     reset;
  422.     exit %Success;
  423.  
  424. Connect_Failure:
  425.     guide %FailureMsg;
  426.     gosub Hangup_Connect;
  427.     reset;
  428.     exit %Failure;
  429.  
  430. Connect_Fatal:
  431.     guide "Connect Fatal";
  432.     gosub Hangup_Connect;
  433.     reset;
  434.     guide "Connect Fatal";
  435.     exit %Fatal;
  436.  
  437. Hangup_Connect:
  438.     if not UsingModem goto Hangup_Done;
  439.     define %LOCAL = 1;
  440. !    call %Dir & "sdisconct.scr" ();
  441. Hangup_Done:
  442.     return;
  443.  
  444. Cancel_Connect:
  445.     guide "Connect cancelled";
  446.     gosub Hangup_Connect;
  447.     reset;
  448.     exit %Cancel;
  449.  
  450. Init_Fatal:
  451.     guide "Could not initialize port";
  452.     gosub Hangup_Connect;
  453.     reset;
  454.     exit %_init;
  455.  
  456. Init_TimeOut:
  457.     guide "タイムアウト";
  458.     gosub Hangup_Connect;
  459.     reset;
  460.     %ErrorCode = 1008;
  461.     exit %ErrorCode;
  462.  
  463. Phone_Error:
  464.     guide "SPHONE.SCRでエラーが発生しました。";
  465.     gosub Hangup_Connect;
  466.     reset;
  467.     exit %ErrorCode;
  468.  
  469. Phone_Exit:
  470.     %ErrorCode = 1012;
  471.     guide "SPHONE.SCRでエラーが発生しました。";
  472.     gosub Hangup_Connect;
  473.     reset;
  474.     exit %ErrorCode;
  475.  
  476.     Connect_Error:
  477.     guide %FailureMsg;
  478.     gosub Hangup_Connect;
  479.     reset;
  480.     exit %ErrorCode;
  481.