home *** CD-ROM | disk | FTP | other *** search
- !---------------------------------------------------------------------!
- ! !
- ! Copyright (c) 1991 !
- ! 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 Script: !
- ! !
- ! Handles CompuServe and Direct. !
- ! !
- ! $Revision:: 1.24 $ !
- ! !
- !---------------------------------------------------------------------!
- ! 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.
-
- !+N
- CompuServe = 1; ! "CompuServe"
- Telenet = 2; ! "SprintNet"
- Tymnet = 3; ! "Tymnet"
- DataPac = 4; ! "DataPac"
- InfoNet_Europe = 5; ! "InfoNet-Euro"
- InfoNet_World = 6; ! "InfoNet-Wrld"
- LATA = 7; ! "LATA"
- CTLATA = 8; ! "LATA-Ct"
- Telepac = 9; ! "Telepac"
- Datex_P = 10; ! "Datex-P"
- Dialplus = 11; ! "GNS Dialplus"
- NIF = 12; ! "NIFTY LL"
- CompuPass = 13; ! "CompuPass"
- FALNET = 14; ! "FALNET"
- Mercury = 15; ! "Mercury"
- CSIRnet = 16; ! "CSIR-Net"
- ISRAKAV = 17; ! "ISRAKAV"
- Direct = 18; ! "Direct"
- !-N
-
- define %CR = "^M";
- define %FALSE = 0;
- define %TRUE = 1;
- hangup = 1;
- UsingModem = %FALSE;
-
- !------------------------!
- ! Main Program !
- !------------------------!
-
- init %Port, %BaudRate;
- if %_init goto Continue_Connect;
-
- define %FailureMsg = "Could not initialize port";
- goto Connect_Fatal;
-
- Continue_Connect:
- call %Dir & "first.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;
- DirectConnect = (%Network = Direct);
- if DirectConnect goto Connect_CIS;
-
- call %Dir & "phone.scr" () : Result;
-
- if Result = %Cancel goto Cancel_Connect;
- if Result = %Failure goto Connect_Failure;
- if Result = %Fatal goto Connect_Fatal;
-
- UsingModem = %TRUE;
-
- if %Network = CompuServe goto Connect_CIS;
- 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_World goto Connect_InfoNet_World;
- 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 = 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;
-
- define %FailureMsg = "Network not supported";
- goto Connect_Fatal;
-
- !----------------------!
- ! Connect to Telenet !
- !----------------------!
-
- Connect_Telenet:
- call %Dir & "telenet.scr" () : Result;
- goto Handle_Network_Return;
-
- !----------------------!
- ! Connect to Tymnet !
- !----------------------!
-
- Connect_Tymnet:
- call %Dir & "tymnet.scr" () : Result;
- goto Handle_Network_Return;
-
- !----------------------!
- ! Connect to DataPac !
- !----------------------!
-
- Connect_DataPac:
- call %Dir & "datapac.scr" () : Result;
- goto Handle_Network_Return;
-
- !-----------------------------!
- ! Connect to InfoNet Europe !
- !-----------------------------!
-
- Connect_InfoNet_Europe:
- call %Dir & "infonet.scr" (%TRUE) : Result;
- goto Handle_Network_Return;
-
- !---------------------------!
- ! Connect to InfoNet World !
- !---------------------------!
-
- Connect_InfoNet_World:
- call %Dir & "infonet.scr" (%FALSE) : Result;
- goto Handle_Network_Return;
-
- !----------------------!
- ! Connect to LATA !
- !----------------------!
-
- Connect_LATA:
- call %Dir & "lata.scr" (%TRUE) : Result;
- goto Handle_Network_Return;
-
- !------------------------------!
- ! Connect to Connecticut LATA !
- !------------------------------!
-
- Connect_CTLATA:
- call %Dir & "lata.scr" (%FALSE) : Result;
- goto Handle_Network_Return;
-
- !----------------------!
- ! Connect to Telepac !
- !----------------------!
-
- Connect_Telepac:
- call %Dir & "telepac.scr" () : Result;
- goto Handle_Network_Return;
-
- !----------------------!
- ! Connect to Datex-P !
- !----------------------!
-
- Connect_Datex_P:
- call %Dir & "datexp.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 & "fenics.scr" (%TRUE) : Result;
- goto Handle_Network_Return;
-
- !------------------------!
- ! Connect to CompuPass !
- !------------------------!
-
- Connect_CompuPass:
- call %Dir & "fenics.scr" (%FALSE) : Result;
- goto Handle_Network_Return;
-
- !------------------------!
- ! Connect to FALNET !
- !------------------------!
-
- Connect_FALNET:
- call %Dir & "falnet.scr" (%FALSE) : Result;
- goto Handle_Network_Return;
-
- !------------------------!
- ! Connect to Mercury !
- !------------------------!
-
- Connect_Mercury:
- call %Dir & "mercury.scr" () : Result;
- goto Handle_Network_Return;
-
- !------------------------!
- ! Connect to CSIR-Net !
- !------------------------!
-
- Connect_CSIRnet:
- call %Dir & "csirnet.scr" () : Result;
- goto Handle_Network_Return;
-
- !------------------------!
- ! Connect to ISRAKAV !
- !------------------------!
-
- Connect_ISRAKAV:
- call %Dir & "israkav.scr" () : Result;
- goto Handle_Network_Return;
-
- !-------------------------!
- ! Handle Network Return !
- !-------------------------!
-
- Handle_Network_Return:
- if Result = %Success goto Do_CIS_Script;
- if Result = %Cancel goto Cancel_Connect;
- if Result = %Fatal goto Connect_Fatal;
- goto Connect_Failure;
-
- !-------------------!
- ! Connect to CIS !
- !-------------------!
-
- Connect_CIS:
- send %CR;
-
- Do_CIS_Script:
- call %Dir & "cserve.scr" (DirectConnect) : Result;
- if Result = %Failure goto Connect_Failure;
- if Result = %Cancel goto Cancel_Connect;
- if Result = %Fatal goto Connect_Fatal;
- exit %Success;
-
- Connect_Failure:
- gosub Hangup_Connect;
- reset;
- exit %Failure;
-
- Connect_Fatal:
- gosub Hangup_Connect;
- reset;
- exit %Fatal;
-
- Hangup_Connect:
- if not UsingModem goto Hangup_Done;
- ifndef %LOCAL = 1;
- call %Dir & "disconct.scr" ();
-
- Hangup_Done:
- return;
-
- Cancel_Connect:
- show "Connect cancelled";
- gosub Hangup_Connect;
- reset;
- exit %Cancel;