home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / tt2man.zip / ttrexx.doc < prev    next >
Text File  |  1993-12-13  |  5KB  |  145 lines

  1.  
  2.                              TABLE OF CONTENTS                              
  3.  
  4.  
  5.           J. Appendix J - REXX  Support
  6.             J.1 Overview
  7.             J.2 Invoking REXX From TalkThru
  8.               J.2.1 From The REXX Dialog
  9.               J.2.2 From A Button Or Keystroke
  10.             J.3 REXX HLLAPI Function Calls
  11.             J.4 Sample REXX Program
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                        J. Appendix J - REXX  Support                        
  18.  
  19.  
  20.                                 J.1 Overview                                
  21.  
  22.  
  23. TalkThru supports the use of the REXX EHLLAPI interface to control  TalkThru
  24. sessions.    In  order for REXX to use EHLLAPI, an  interface  driver  named
  25. SAAHLAPI.DLL  must  be  available.     This  driver  is  provided  with  the
  26. Communications  Manager, but if you DO NOT have the  Communications  Manager
  27. present on your PC, you MUST specify that the Communications Manager IS  NOT
  28. present when you install TalkThru.
  29.  
  30. When  you  indicate, during TalkThru installation, that  the  Communications
  31. Manager  IS  NOT  present, TalkThru  installs,  into  the  PROGRAM_DIRECTORY
  32. (usually  C:\TALKTHRU\PROGRAMS),  a  TalkThru  version  of  SAAHLAPI.DLL  to
  33. provide  this  interface.  Therefore, in order to  effectively  utilize  the
  34. EHLLAPI capabilities of REXX, please remember the following:
  35.  
  36. 1. If  you  DO NOT have the Communications Manager, you MUST  indicate  this
  37.    when  you  install  TalkThru,  or   the  REXX  EHLLAPI  interface  module
  38.    (SAAHLAPI.DLL) will not be available.
  39.  
  40. 2. If you install the Communications Manager after installing TalkThru,  you
  41.    may  wish  to  erase    the     SAAHLAPI.DLL  module  from  the  TalkThru
  42.    PROGRAM_DIRECTORY.
  43.  
  44.  
  45.  
  46.  
  47.                       J.2 Invoking REXX From TalkThru                       
  48.  
  49.  
  50.  
  51. ┌────────────────────────────┐
  52. │ J.2.1 From The REXX Dialog │
  53. └────────────────────────────┘
  54.  
  55.   REXX programs may be invoked by selecting REXX... from the Utilities  pull
  56.   down menu on any Phone Book or the Command pull down menu on any  Terminal
  57.   Window.
  58.  
  59.   This  menu  item will cause the Terminal Emulator and phone  book  to  act
  60.   EXACTLY  as if the AUTOPILOT menu selection was chosen. HOWEVER, there  is
  61.   NO COMPILE  option.    Instead  of   calling  AUOTOPILOT,  a  new  program
  62.   TT2REXX.EXE  is  called. This program calls the OS/2  REXXStart  function.
  63.   The created REXX environment is identical to the environment created  when
  64.   a REXX  COMMAND *.cmd  file is typed on the  OS/2 command line.  There  is
  65.   NO return value or RC from the REXX program.
  66.  
  67.   If the  REXX  program issues the PARSE SOURCE function, the  word  COMMAND
  68.   will  be returned. If the REXX program queries the ADDRESS  function,  the
  69.   word  returned  will  be  the EXT of the REXX  (program)  file  name.  For
  70.   example:
  71.  
  72.     REXX Program file name = printit.CMD
  73.     rc = ADDRESS()
  74.     rc is the word CMD
  75.  
  76.     REXX Program file name = printit.REX
  77.     rc = ADDRESS()
  78.     rc is the word REX
  79.  
  80. ┌──────────────────────────────────┐
  81. │ J.2.2 From A Button Or Keystroke │
  82. └──────────────────────────────────┘
  83.  
  84.   To launch  a  REXX program from a Terminal Emulator Button  or  Keystroke,
  85.   the following Command may be used in the Assignment field when defining  a
  86.   Button or Keystroke:
  87.  
  88.       RUN_REXX
  89.  
  90.   This  command  is identical to the already  existing  command  RUN_SCRIPT.
  91.   For example,  if  you  wished to run the REXX  program  rexxprog.rex,  you
  92.   would indicate the following Assignment:
  93.  
  94.       RUN_REXX,"rexxprog.rex"
  95.  
  96.   The environment  established  for  REXX is the same as  indicated  in  the
  97.   previous section, From The REXX Dialog.
  98.  
  99.  
  100.  
  101.  
  102.                        J.3 REXX HLLAPI Function Calls                       
  103.  
  104.  
  105. For more information on REXX hllapi functions refer to the IBM publication:
  106.  
  107.   Extended Services for OS/2
  108.   EHLLAPI programming Reference
  109.   Doc Number: S04G-1027-xx   xx = current revision
  110.  
  111.   Appendix F, REXX EHLLAPI Functions
  112.  
  113. REMEMBER:
  114.      To provide  EHLLAPI support for REXX, the module SAAHLAPI.DLL  must  be
  115.      available  in the LIBPATH.  If you DO NOT have the  IBM  Communications
  116.      Manager  installed,  refer  to  the first  section  of  this  Appendix,
  117.      Overview for more information on how to make it available.
  118.  
  119.  
  120.  
  121.  
  122.                           J.4 Sample REXX Program                           
  123.  
  124.  
  125. Below  is  a  sample REXX program which demonstrates how to  setup  and  use
  126. HLLAPi functions from a REXX program.
  127.  
  128.   if RxFuncQuery('hllapi')  = 0 then
  129.     call RxFuncAdd 'hllapi', 'SAAHLAPI', 'hllapisrv'
  130.  
  131.   rc = hllapi('Connect',sessionID)
  132.   if rc <> 0 then do
  133.     /* error processing, rc has return code */
  134.   end
  135.  
  136.   rc = hllapi('SendKey','LOGON HOSTID')
  137.   if rc <> 0 then do
  138.     /* error processing, rc has return code */
  139.   end
  140.  
  141.   rc = hllapi('Disconnect')
  142.   if rc <> 0 then do
  143.     /* error processing, rc has return code */
  144.   end
  145.