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. !
- ! !
- ! InfoNet Script: !
- ! Connect to InfoNet or InfoNet-Europe. Arg1 contains TRUE if !
- ! connect is to InfoNet-Europe and FALSE otherwise. !
- ! Success: returns %Success !
- ! Failure: saves error msg in %FailureMsg and returns %Failure !
- ! !
- ! $Revision:: 1.4 $ !
- ! !
- !---------------------------------------------------------------------!
-
- show "Connecting to InfoNet";
- Tries = 5;
-
- Europe = Arg1;
- Timeout = 10;
- Got_Center = %FALSE;
- on cancel goto Return_Cancel;
- FailStr = "InfoNet not responding";
-
- Wait_InfoNet:
-
- wait
- "#" goto Send_Response,
- "Center" goto Send_InfoNet_Host,
- "Centre" goto Send_InfoNet_Host,
- "COMMUNICATION" goto Return_Success
- until Timeout;
-
- Timeout = 50;
- if Tries = 0 goto InfoNet_Failure;
-
- Tries = Tries - 1;
- send %CR & %CR & %CR;
- goto Wait_InfoNet;
-
- Send_Response:
-
- if Got_Center goto Wait_InfoNet;
-
- send "C" & %CR;
- Timeout = 195;
- goto Wait_InfoNet;
-
- Send_InfoNet_Host:
-
- if Europe goto Send_InfoNet_Europe_Host;
- send "CPS" & %CR;
- goto Finish_Send_Host;
-
- Send_InfoNet_Europe_Host:
-
- send "CSF" & %CR;
-
- Finish_Send_Host:
-
- FailStr = "InfoNet not connecting";
- if Tries = 0 goto InfoNet_Failure;
-
- Tries = Tries - 1;
- Got_Center = %TRUE;
- Timeout = 835;
- goto Wait_InfoNet;
-
- InfoNet_Failure:
- define %FailureMsg = FailStr;
- exit %Failure;
-
- Return_Cancel:
- exit %Cancel;
-
- Return_Success:
- exit %Success;