home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxhll.zip / HLLAPI.REX < prev    next >
OS/2 REXX Batch file  |  1993-04-22  |  1KB  |  63 lines

  1.  
  2. /* #include hllapi.rex */
  3.  
  4. /**
  5. *** ┌──────────────────────────────────────────────────────────────────────┐
  6. *** │                           HLLAPI Routines                            │
  7. *** └──────────────────────────────────────────────────────────────────────┘
  8. **/
  9.  
  10. HapiLoadFunctions: procedure
  11.    /**
  12.    ***  This will load the DLL used by REXX HLLAPI
  13.    **/
  14.  
  15.    if RxFuncQuery('HLLAPI') then
  16.       call RxFuncAdd 'HLLAPI','SAAHLAPI','HLLAPISRV'
  17.    return
  18.  
  19.  
  20. HapiError: procedure expose Host.
  21.    /**
  22.    ***
  23.    **/
  24.    arg code verb .
  25.  
  26.    say 'Return code' code 'from HLLAPI command:' verb'.'
  27.    call HapiDisconnect
  28.    exit
  29.  
  30.  
  31. HapiDisconnect: procedure expose Host.
  32.    /**
  33.    ***  This will disconnect the HLLAPI session from the host
  34.    **/
  35.    call hllapi 'disconnect'
  36.    call hllapi 'reset_system'
  37.    return
  38.  
  39.  
  40. HapiConnect: procedure expose Host.
  41.    /**
  42.    ***  This will connect to the host session and make sure the keyboard is
  43.    ***  unlocked.
  44.    **/
  45.  
  46.    rc = hllapi('Connect',Host.Session)
  47.    if rc <> 0 then
  48.       call HapiError rc 'Connect'
  49.  
  50.    rc=hllapi('Wait')
  51.    if rc <> 0 then
  52.       call HapiError rc 'Wait'
  53.    return
  54.  
  55.  
  56. HapiClear: procedure expose Host.
  57.    /**
  58.    ***  This will clear the host screen
  59.    **/
  60.    rc=hllapi('Sendkey', '@C')    /* Send a clear key */
  61.    rc=hllapi('Wait')             /* Wait for clear key to complete */
  62.    return
  63.