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 >
Wrap
Text File
|
1996-11-19
|
11KB
|
481 lines
%ShowdEnable = 1;
!
! Copyright (c) 1995
! by NIFTY Corporation, Tokyo, Japan
! by CompuServe Incorporated, Columbus, Ohio
!
! The information in this software is subject to change without
! notice and should not be construed as a commitment by CompuServe.
!
! CONNECT:
! Handles NIFTY-Serve and Direct.
!
! NOTE: It is recommended that the numeric codes for networks NOT be
! modified since other utility programs may assume the relationships
! of network names and network ids specified below.
!
!+V
! "3.5"
!-V
!+N
CompuServe = 1; ! "CompuServe"
FALNET = 14; ! "FALNET"
FENICS_II = 42; ! "FENICS-ROAD 2"
FENICS_IV = 43; ! "FENICS-ROAD 4"
FENICS_V = 47; ! "FENICS-ROAD 5"
INS-C = 44; ! "FENICS-ROAD 3 INS-C"
V32 = 45; ! "FENICS-ROAD 3 V32"
MNP10 = 46; ! "FENICS-ROAD 3 MNP10"
DOCOMO = 49; ! "FENICS-ROAD 3 DOCOMO"
FENICS2.SCR = 42; ! "FENICS-ROAD 2"
FENICS4.SCR = 43; ! "FENICS-ROAD 4"
FENICS5.SCR = 47; ! "FENICS-ROAD 5"
INSC.SCR = 44; ! "FENICS-ROAD 3 INS-C"
V32.SCR = 45; ! "FENICS-ROAD 3 V32"
MNP10.SCR = 46; ! "FENICS-ROAD 3 MNP10"
DOCOMO.SCR = 49; ! "FENICS-ROAD 3 DOCOMO"
Infonet = 50; ! "Infonet"
Dialplus = 11; ! "GNS Dialplus"
InfoNet-Euro = 5; ! "InfoNet-Euro"
InfoNet-Kor = 29; ! "InfoNet-Kor"
InfoNet-Mex = 31; ! "InfoNet-Mex"
InfoNet-RSA = 32; ! "InfoNet-RSA"
InfoNet-Taiw = 30; ! "InfoNet-Taiw"
ISRAKAV = 17; ! "ISRAKAV"
Mercury = 15; ! "Mercury"
Transpac = 18; ! "Transpac"
VNZ-Net = 23; ! "VNZ-Net"
Direct = 40; ! "Direct"
!-N
define %CR = "^M";
define %ENQ = "^E";
define %ACK = "^F";
define %NAK = "^U";
define %XOFF = "^Q";
define %FALSE = 0;
define %TRUE = 1;
define %ErrorCode = 0;
hangup = 1;
UsingModem = %FALSE;
NIFNetwork = %FALSE;
!
! Main Program
!
init %Port, %BaudRate;
if %_init = 1001 goto Init_Fatal;
if %_init = 1002 goto Init_Fatal;
if %_init = 1003 goto Init_Fatal;
if %_init = 1004 goto Init_Fatal;
if %_init = 1005 goto Init_Fatal;
if %_init = 1006 goto Init_Fatal;
if %_init = 1007 goto Init_Fatal;
if %_init = 9 goto Init_TimeOut;
goto Continue_Connect;
;if %_init goto Continue_Connect;
define %FailureMsg = "Could not initialize port";
define %ErrorCode = 2;
define %DialType = 0;
goto Connect_Fatal;
Continue_Connect:
call %Dir & "sfirst.scr" () : Result;
if Result = %Cancel goto Cancel_Connect;
if Result = %Failure goto Connect_Failure;
if Result = %Fatal goto Connect_Fatal;
on cancel goto Cancel_Connect;
call %Dir & "sphone.scr" () : Result;
if Result = %Success goto Connect_Network;
if Result = %Cancel goto Cancel_Connect;
if Result = %Failure goto Connect_Failure;
if Result = %ErrorCode goto Phone_Error;
if Result = %Fatal goto Connect_Fatal;
goto Phone_Exit;
! UsingModem = %TRUE;
Connect_Network:
if %Network = FENICS_II goto Connect_FENICS_II;
if %Network = FENICS2.SCR goto Connect_FENICS_II;
if %Network = FENICS_IV goto Connect_FENICS_IV;
if %Network = FENICS4.SCR goto Connect_FENICS_IV;
if %Network = FENICS_V goto Connect_FENICS_V;
if %Network = FENICS5.SCR goto Connect_FENICS_V;
if %Network = V32 goto Connect_V32;
if %Network = V32.SCR goto Connect_V32;
if %Network = INS-C goto Connect_INS-C;
if %Network = INS-C.SCR goto Connect_INS-C;
if %Network = MNP10 goto Connect_MNP10;
if %Network = MNP10.SCR goto Connect_MNP10;
if %Network = DOCOMO goto Connect_DOCOMO;
if %Network = DOCOMO.SCR goto Connect_DOCOMO;
if %Network = CompuServe goto Connect_CIS;
if %Network = Direct goto Connect_NIF;
if %Network = Telenet goto Connect_Telenet;
if %Network = Tymnet goto Connect_Tymnet;
if %Network = DataPac goto Connect_DataPac;
if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
if %Network = InfoNet_Korea goto Connect_InfoNet_Korea;
if %Network = InfoNet_Taiwan goto Connect_InfoNet_Taiwan;
if %Network = InfoNet_Mexico goto Connect_InfoNet_Mexico;
if %Network = InfoNet_SAfrica goto Connect_InfoNet_SAfrica;
if %Network = InfoNet_World goto Connect_InfoNet_World;
if %Network = Infonet goto Connect_InfoNet;
if %Network = Internet goto Connect_Internet;
if %Network = LATA goto Connect_LATA;
if %Network = CTLATA goto Connect_CTLATA;
if %Network = Telepac goto Connect_Telepac;
if %Network = Datex_P goto Connect_Datex_P;
if %Network = Hungary goto Connect_Hungary;
if %Network = Datex_J goto Connect_Datex_J;
if %Network = Dialplus goto Connect_Dialplus;
if %Network = NIF goto Connect_NIF;
if %Network = CompuPass goto Connect_CompuPass;
if %Network = FALNET goto Connect_FALNET;
if %Network = Mercury goto Connect_Mercury;
if %Network = CSIRnet goto Connect_CSIRnet;
if %Network = ISRAKAV goto Connect_ISRAKAV;
if %Network = Transpac goto Connect_Transpac;
if %Network = PacNet goto Connect_PacNet;
if %Network = PosServe goto Connect_PosServe;
if %Network = VNZNET goto Connect_NIF;
if %Network = Chilepac goto Connect_Chilepac;
define %FailureMsg = "Network not supported";
goto Connect_Fatal;
!
! Connect to Telenet
!
Connect_Telenet:
call %Dir & "stelenet.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to Tymnet
!
Connect_Tymnet:
call %Dir & "stymnet.scr" (1) : Result;
goto Handle_Network_Return;
!
! Connect to DataPac
!
Connect_DataPac:
call %Dir & "sdatapac.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to InfoNet
!
Connect_InfoNet:
call %Dir & "sinfonet.scr" (0) : Result;
goto Handle_Network_Return;
!
! Connect to InfoNet World
!
Connect_InfoNet_World:
call %Dir & "sinfonet.scr" (0) : Result;
goto Handle_Network_Return;
!
! Connect to InfoNet Europe
!
Connect_InfoNet_Europe:
call %Dir & "sinfonet.scr" (1) : Result;
goto Handle_Network_Return;
!
! Connect to InfoNet Korea
!
Connect_InfoNet_Korea:
call %Dir & "sinfonet.scr" (2) : Result;
goto Handle_Network_Return;
!
! Connect to InfoNet Taiwan
!
Connect_InfoNet_Taiwan:
call %Dir & "sinfonet.scr" (3) : Result;
goto Handle_Network_Return;
!
! Connect to InfoNet Mexico
!
Connect_InfoNet_Mexico:
call %Dir & "sinfonet.scr" (4) : Result;
goto Handle_Network_Return;
!
! Connect to InfoNet South Africa
!
Connect_InfoNet_SAfrica:
call %Dir & "sinfonet.scr" (5) : Result;
goto Handle_Network_Return;
!
! Connect to LATA
!
Connect_LATA:
call %Dir & "slata.scr" (%TRUE) : Result;
goto Handle_Network_Return;
!
! Connect to Connecticut LATA
!
Connect_CTLATA:
call %Dir & "slata.scr" (%FALSE) : Result;
goto Handle_Network_Return;
!
! Connect to Connecticut LATA
!
Connect_Internet:
call %Dir & "internet.scr" (%FALSE) : Result;
goto Handle_Network_Return;
!
! Connect to Telepac
!
Connect_Telepac:
call %Dir & "stelepac.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to Datex-P
!
Connect_Datex_P:
call %Dir & "sdatexp.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to Datex-P/Hungary
!
Connect_Hungary:
call %Dir & "shungary.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to Datex-J
!
Connect_Datex_J:
call %Dir & "sdatexj.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to Dialplus
!
Connect_Dialplus:
call %Dir & "dialplus.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to NIF
!
Connect_NIF:
call %Dir & "sfenics.scr" (%TRUE) : Result;
goto Handle_Network_Return;
!
! Connect to CompuPass
!
Connect_CompuPass:
call %Dir & "sfenics.scr" (%FALSE) : Result;
goto Handle_Network_Return;
!
! Connect to FALNET
!
Connect_FALNET:
call %Dir & "sfalnet.scr" (%FALSE) : Result;
goto Handle_Network_Return;
!
! Connect to Mercury
!
Connect_Mercury:
call %Dir & "smercury.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to CSIR-Net
!
Connect_CSIRnet:
call %Dir & "scsirnet.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to ISRAKAV
!
Connect_ISRAKAV:
call %Dir & "sisrakav.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to Transpac
!
Connect_Transpac:
call %Dir & "transpac.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to AlaskaNet
!
Connect_AlaskaNet:
call %Dir & "stymnet.scr" (2) : Result;
goto Handle_Network_Return;
!
! Connect to PacNet
!
Connect_PacNet:
call %Dir & "stymnet.scr" (3) : Result;
goto Handle_Network_Return;
!
! Connect to Pos-Serve
!
Connect_PosServe:
call %Dir & "posserve.scr" () : Result;
goto Handle_Network_Return;
!
! Connect to FENICS II
!
Connect_FENICS_II:
call %Dir & "sfenics2.scr" (3) : Result;
goto Handle_Network_Return;
Connect_FENICS_IV:
call %Dir & "sfenics4.scr" (3) : Result;
goto Handle_Network_Return;
Connect_FENICS_V:
call %Dir & "sfenics5.scr" (3) : Result;
goto Handle_Network_Return;
Connect_V32:
call %Dir & "sv32.scr" (3) : Result;
goto Handle_Network_Return;
Connect_INS-C:
call %Dir & "sinsc.scr" (3) : Result;
goto Handle_Network_Return;
Connect_MNP10:
call %Dir & "smnp10.scr" (3) : Result;
goto Handle_Network_Return;
Connect_DOCOMO:
call %Dir & "sdocomo.scr" (3) : Result;
goto Handle_Network_Return;
Connect_CIS:
call %Dir & "scserve.scr" (3) : Result;
goto Handle_Network_Return;
Connect_Infonet:
call %Dir & "sinfonet.scr" (3) : Result;
goto Handle_Network_Return;
!
! Connect to Chilepac
!
Connect_Chilepac:
call %Dir & "chilepac.scr" (3) : Result;
goto Handle_Network_Return;
!
! Handle Network Return
!
Handle_Network_Return:
if Result = %Success goto Do_NIF_Script;
if Result = %Cancel goto Cancel_Connect;
if Result = %Fatal goto Connect_Fatal;
if Result = %ErrorCode goto Connect_Error;
goto Connect_Failure;
!
! Connect to NIF
!
Connect_NIF:
NIFNetwork = %TRUE;
send %CR;
Do_NIF_Script:
! call %Dir & "scserve.scr" (DirectConnect, NIFNetwork) : Result;
! if Result = %Failure goto Connect_Failure;
! if Result = %Cancel goto Cancel_Connect;
! if Result = %Fatal goto Connect_Fatal;
guide "Connect Successful";
reset;
exit %Success;
Connect_Failure:
guide %FailureMsg;
gosub Hangup_Connect;
reset;
exit %Failure;
Connect_Fatal:
guide "Connect Fatal";
gosub Hangup_Connect;
reset;
guide "Connect Fatal";
exit %Fatal;
Hangup_Connect:
if not UsingModem goto Hangup_Done;
define %LOCAL = 1;
! call %Dir & "sdisconct.scr" ();
Hangup_Done:
return;
Cancel_Connect:
guide "Connect cancelled";
gosub Hangup_Connect;
reset;
exit %Cancel;
Init_Fatal:
guide "Could not initialize port";
gosub Hangup_Connect;
reset;
exit %_init;
Init_TimeOut:
guide "タイムアウト";
gosub Hangup_Connect;
reset;
%ErrorCode = 1008;
exit %ErrorCode;
Phone_Error:
guide "SPHONE.SCRでエラーが発生しました。";
gosub Hangup_Connect;
reset;
exit %ErrorCode;
Phone_Exit:
%ErrorCode = 1012;
guide "SPHONE.SCRでエラーが発生しました。";
gosub Hangup_Connect;
reset;
exit %ErrorCode;
Connect_Error:
guide %FailureMsg;
gosub Hangup_Connect;
reset;
exit %ErrorCode;