home *** CD-ROM | disk | FTP | other *** search
- !
- ! Copyright (c) 1994
- ! 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.
- !
- ! TYMNET:
- ! Connect to Tymnet
- ! Success: returns %Success
- ! Failure: saves error msg in %FailureMsg and returns %Failure
- !
- ! Which_Tymnet: Tymnet = 1, AlaskaNet = 2, PacNet = 3
- !
- !+V
- ! "3.5.2"
- !-V
-
- A_Sent = %FALSE;
- CR_Sent = %FALSE;
-
- on cancel goto Return_Cancel;
- Which_Tymnet = Arg1;
- if Which_Tymnet = 2 goto Show_AlaskaNet;
- if Which_Tymnet = 3 goto Show_PacNet;
-
- show "Connecting to TYMNET";
- goto Wait_Tymnet;
-
- Show_AlaskaNet:
- show "Connecting to AlaskaNet";
- goto Wait_Tymnet;
-
- Show_PacNet:
- show "Connecting to PacNet";
-
- Wait_Tymnet:
- wait
- "Please " goto Send_A,
- "xxx" goto Send_A,
- "log in:" goto Send_Tymnet_Host,
- "User Name" goto Send_Tymnet_Host,
- "COMPUSERVE" goto Return_Success,
- "User ID:" goto Return_Success
- until 85;
-
- if not CR_Sent goto Send_CR;
- if not A_Sent goto Send_A;
- goto Tymnet_Failure;
-
- Send_CR:
- send %CR & %CR;
- CR_Sent = %TRUE;
- goto Wait_Tymnet;
-
- Send_A:
- if A_Sent goto Wait_Tymnet;
- send "A";
- A_Sent = %TRUE;
- goto Wait_Tymnet;
-
- Send_Tymnet_Host:
- if Which_Tymnet = 3 goto Send_Pac_Host;
- send "CPS" & %CR;
- goto Wait_Tymnet;
-
- Send_Pac_Host:
- send "CNSG" & %CR;
- goto Wait_Tymnet;
-
- Tymnet_Failure:
- if Which_Tymnet = 2 goto AlaskaNet_Failure;
- if Which_Tymnet = 3 goto PacNet_Failure;
- define %FailureMsg = "Tymnet: No answer";
- exit %Failure;
-
- AlaskaNet_Failure:
- define %FailureMsg = "AlaskaNet: No answer";
- exit %Failure;
-
- PacNet_Failure:
- define %FailureMsg = "PacNet: No answer";
- exit %Failure;
-
- Return_Cancel:
- exit %Cancel;
-
- Return_Success:
- exit %Success;
-