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

  1. /* This program genie.cmd created by Hilgraeve and assigned to the Genie     */
  2. /* phonebook entry runs an automated logon script for connecting to Genie.   */
  3.  
  4. /*    $Revision: 1.4 $  */
  5. /*    $Date: 1995/09/13 10:46:19 $  */
  6.  
  7. /* Text within slashes and asterisks (like this line) are comments. */
  8. /* Parse the command line for arguments passed to this program */
  9. PARSE ARG pipename
  10.  
  11. /* Register external functions with REXX */
  12. CALL RxFuncAdd 'haLoadFuncs', 'HA_AUTO', 'RxhaLoadFuncs'
  13. CALL haLoadFuncs
  14.  
  15. /* Establish a link between this script program and HyperACCESS */
  16. scripthandle = 0
  17. scripthandle = haInitialize(1, pipename)
  18.  
  19. DROP pipename
  20. /* Process only if link with HyperACCESS was successful */
  21. IF scripthandle <> 0 THEN
  22.     DO
  23.     /* Initialize useful variables */
  24.     cr = '0D'x
  25.     lf = '0A'x
  26.     returnvalue = 0
  27.  
  28.     /* Type three 'h's then <enter> */
  29.     IF returnvalue >= 0 THEN
  30.         returnvalue = haTypeText(scripthandle, 0, 'hhh'cr)
  31.  
  32.     /* Wait for id/password prompt */
  33.     IF returnvalue >= 0 THEN
  34.         returnvalue = haWaitForPrompt(scripthandle, 1, 'U#=', 300, 16000)
  35.  
  36.     /* Get/prompt for User ID value from Runtime Values dialog box */
  37.     IF returnvalue >= 0 THEN
  38.         returnvalue = haGetRuntimeValue(scripthandle, 2, 1, 128, 'idval')
  39.  
  40.     /* Get/prompt for Password value from Runtime Values dialog box */
  41.     IF returnvalue >= 0 THEN
  42.         returnvalue = haGetRuntimeValue(scripthandle, 3, 1, 128, 'passval')
  43.  
  44.     /* Type the logline */
  45.     IF returnvalue >= 0 THEN
  46.         ReturnValue = haTypeText(scripthandle, 0, idval','passval||cr)
  47.             
  48.     /* Terminate link between HyperACCESS and script program */
  49.     CALL haTerminate scripthandle
  50.     END
  51.  
  52. DROP scripthandle
  53. CALL haDropFuncs
  54.