home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / haotd1_1.zip / ATTMAIL.CMD < prev    next >
OS/2 REXX Batch file  |  1995-10-12  |  2KB  |  64 lines

  1. /* This program attmail.cmd, created by Hilgraeve and assigned to the */
  2. /* AT&T Mail phonebook entry runs an automated logon script for connecting */
  3. /* to the AT&T Mail service */
  4.  
  5. /*  $Revision: 1.6 $  */
  6. /*  $Date: */
  7.  
  8. /* A REXX script MUST begin with a commented line */
  9. /* Text within slashes and asterisks (like this line) are comments. */
  10.  
  11. /* Parse the command line for arguments passed to this program */
  12. PARSE ARG pipename
  13.  
  14. /* Register external functions with REXX */
  15. CALL RxFuncAdd 'haLoadFuncs', 'HA_AUTO', 'RxhaLoadFuncs'
  16. CALL haLoadFuncs
  17.  
  18. /* Establish a link between this script program and HyperACCESS */
  19. scripthandle = 0
  20. scripthandle = haInitialize(1, pipename)
  21. DROP pipename
  22.  
  23. /* Process only if link with HyperACCESS was successful */
  24. IF scripthandle <> 0 THEN
  25.     DO
  26.     /* Initialize useful variables */
  27.     cr = '0D'x      /* This is the hex value for carriage return */
  28.     lf = '0A'x      /* This is the hex value for line feed       */
  29.     nul = '00'x
  30.     returnvalue = 0
  31.  
  32.     /* If the returnvalue is ok, we'll wait for the first prompt */
  33.     IF returnvalue >= 0 THEN
  34.         returnvalue = haWaitForPrompt(scripthandle, 1, ' Name:  ', 300, 100000)
  35.  
  36.     /* Query the user name value from the Runtime Values dialog box */
  37.     IF returnvalue >= 0 THEN
  38.         returnvalue = haGetRuntimeValue(scripthandle, 1, 1, 128, 'Buffer')
  39.  
  40.     /* Type the value stored in the user name runtime value */
  41.     IF returnvalue >= 0 THEN
  42.         returnvalue = haTypeText(scripthandle, 0, Buffer || cr)
  43.  
  44.     /* Wait for the password prompt */
  45.     IF returnvalue >= 0 THEN
  46.         returnvalue = haWaitForPrompt(scripthandle, 1, 'ssword:', 300, 32000)
  47.  
  48.     /* Query the password value from the Runtime Values dialog */    
  49.     IF returnvalue >= 0 THEN
  50.         returnvalue = haGetRuntimeValue(scripthandle, 3, 1, 128, 'BufferPas')
  51.  
  52.     /* Type the value stored in the password runtime value */
  53.     IF returnvalue >= 0 THEN
  54.         returnvalue = haTypeText(scripthandle, 0, BufferPas || cr)
  55.  
  56.     /* Terminate link between HyperACCESS and script program */
  57.     CALL haTerminate (scripthandle)
  58.     END
  59.  
  60. /* Drop the scripthandle variable from memory   */
  61. DROP scripthandle
  62. CALL haDropFuncs
  63.  
  64.