home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0330 - 0339 / ibm0330-0339 / ibm0333.tar / ibm0333 / LEX27WIN.ZIP / SPRNTNET.DCP / SPRNTNET.DCP
Encoding:
Text File  |  1994-01-10  |  4.8 KB  |  161 lines

  1. ; $Id: sprntnet.dcp 1.4 1994/01/10 14:12:10 slc Exp $
  2. ;**************************************************************************
  3. ;* SPRNTNET.DCP
  4. ;*
  5. ;* Description : LEXIS/NEXIS Research Software SprintNet Login Module
  6. ;*
  7. ;* Target version: LEXIS/NEXIS Research Software Custom Build of
  8. ;*                 DynaComm Asyncronous version 3.10.02
  9. ;*
  10. ;* Copyright (C) 1992 - 1993 by FutureSoft Engineering, All Rights Reserved
  11. ;*
  12. ;**************************************************************************
  13.  
  14. *Login( $szNodeID )
  15.  
  16. PERFORM "WLXLOGIN*LoginUpdateProgressDialog"( "Accessing SprintNet", "_HOUR3" )
  17.  
  18. #Waiting = FALSE
  19. ;-------------------------------------------------------------
  20. ; Set a timer for one minute to be activated at a WAIT command
  21. ;-------------------------------------------------------------
  22. WHEN TIMER "00:01:00"
  23.  BEGIN
  24.    ;------------------------------------------
  25.    ; Cancel the WHEN's defined in this routine
  26.    ;------------------------------------------
  27.    WHEN CANCEL TIMER
  28.    WHEN CANCEL STRING 0
  29.  
  30.    ;----------------------------------------------
  31.    ; Set the result string for the calling routine
  32.    ;----------------------------------------------
  33.    SET RESULT "TIMEOUT"
  34.    if #Waiting
  35.       RESUME
  36.    else
  37.       RETURN
  38.  END
  39.  
  40. ;---------------------------------------------------------
  41. ; Execute the following block of code when the "TERMINAL="
  42. ; string is received while at the WAIT RESUME command.
  43. ;---------------------------------------------------------
  44. WHEN STRING 0 "TERMINAL="
  45.  BEGIN
  46.    ;-----------------
  47.    ; Cancel this WHEN
  48.    ;-----------------
  49.    WHEN CANCEL STRING 0
  50.    ;-----------------------------------------------------------
  51.    ; Execute the following block of code when the '@' character
  52.    ; is received while at the WAIT RESUME command.
  53.    ;-----------------------------------------------------------
  54.    WHEN STRING 1 "@"
  55.     BEGIN
  56.       ;-----------------
  57.       ; Cancel this WHEN
  58.       ;-----------------
  59.       WHEN CANCEL STRING 1
  60.       ;----------------------------------------------------------
  61.       ; Resume script execution following the WAIT RESUME command
  62.       ;----------------------------------------------------------
  63.       RESUME
  64.     END   ; when string 1
  65.    ;------------------------------------------------------
  66.    ; Send a string to SprintNet in response to "TERMINAL="
  67.    ;------------------------------------------------------
  68.    SEND "D1"
  69.  END   ; when string 0
  70.  
  71. ;-----------------------------------------
  72. ; Begin script execution here
  73. ;-----------------------------------------
  74.  
  75. ;--------------------------------
  76. ; Pause 2 seconds before starting
  77. ;--------------------------------
  78. WAIT QUIET "2"
  79.  
  80. ;-----------------------------------
  81. ; If the baud rate is less than 2400
  82. ;-----------------------------------
  83. if (NUM(SETTINGS(BAUDRATE)) < 2400)
  84.  BEGIN
  85.    ;-----------------------
  86.    ; Send a carriage return
  87.    ;-----------------------
  88.    SEND ""
  89.    ;----------------
  90.    ; Wait one second
  91.    ;----------------
  92.    WAIT DELAY "1"
  93.    SEND ";"
  94.  END
  95. else
  96.  BEGIN
  97.    ;-------------------------------------------------
  98.    ; Send the '@' character without a carriage return
  99.    ;-------------------------------------------------
  100.    SEND NOCR "@"
  101.    ;----------------
  102.    ; Wait one second
  103.    ;----------------
  104.    WAIT DELAY "1"
  105.    ;-----------------------
  106.    ; Send a carriage return
  107.    ;-----------------------
  108.    SEND ""
  109.  END
  110.  
  111. ;-----------------------------------------------------------------------------
  112. ; Allow this script to be cancelled as a result of the user pressing the
  113. ; "Cancel" button in the login progress dialog created by the calling routine.
  114. ;-----------------------------------------------------------------------------
  115. if (#bCancel)
  116.  BEGIN
  117.    WHEN CANCEL TIMER
  118.    WHEN CANCEL STRING 0
  119.    WHEN CANCEL STRING 1
  120.    ;----------------------------------------------
  121.    ; Set the result string for the calling routine
  122.    ;----------------------------------------------
  123.    SET RESULT "CANCEL"
  124.    RETURN
  125.  END
  126.  
  127. ;---------------------------------------------
  128. ; Wait for string to be received from the host
  129. ;---------------------------------------------
  130. #Waiting = TRUE
  131. WAIT RESUME
  132. #Waiting = FALSE
  133.  
  134. if (RESULT() == "TIMEOUT")
  135.    RETURN
  136.    
  137. ;-----------------------
  138. ; Check for cancel again
  139. ;-----------------------
  140. if (#bCancel)
  141.  BEGIN
  142.    WHEN CANCEL TIMER
  143.    WHEN CANCEL STRING 0
  144.    WHEN CANCEL STRING 1
  145.    SET RESULT "CANCEL"
  146.    RETURN
  147.  END
  148.  
  149. ;----------------------------
  150. ; Send the predefined node id
  151. ;----------------------------
  152. SEND TRIM($szNodeID)
  153.  
  154. ;--------------------------------------------------------------
  155. ; Cancel the WHEN TIMER before returning to the calling routine
  156. ;--------------------------------------------------------------
  157. WHEN CANCEL TIMER
  158.  
  159. RETURN
  160.  
  161.