home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
tt2man.zip
/
ttrexx.doc
< prev
next >
Wrap
Text File
|
1993-12-13
|
5KB
|
145 lines
TABLE OF CONTENTS
J. Appendix J - REXX Support
J.1 Overview
J.2 Invoking REXX From TalkThru
J.2.1 From The REXX Dialog
J.2.2 From A Button Or Keystroke
J.3 REXX HLLAPI Function Calls
J.4 Sample REXX Program
J. Appendix J - REXX Support
J.1 Overview
TalkThru supports the use of the REXX EHLLAPI interface to control TalkThru
sessions. In order for REXX to use EHLLAPI, an interface driver named
SAAHLAPI.DLL must be available. This driver is provided with the
Communications Manager, but if you DO NOT have the Communications Manager
present on your PC, you MUST specify that the Communications Manager IS NOT
present when you install TalkThru.
When you indicate, during TalkThru installation, that the Communications
Manager IS NOT present, TalkThru installs, into the PROGRAM_DIRECTORY
(usually C:\TALKTHRU\PROGRAMS), a TalkThru version of SAAHLAPI.DLL to
provide this interface. Therefore, in order to effectively utilize the
EHLLAPI capabilities of REXX, please remember the following:
1. If you DO NOT have the Communications Manager, you MUST indicate this
when you install TalkThru, or the REXX EHLLAPI interface module
(SAAHLAPI.DLL) will not be available.
2. If you install the Communications Manager after installing TalkThru, you
may wish to erase the SAAHLAPI.DLL module from the TalkThru
PROGRAM_DIRECTORY.
J.2 Invoking REXX From TalkThru
┌────────────────────────────┐
│ J.2.1 From The REXX Dialog │
└────────────────────────────┘
REXX programs may be invoked by selecting REXX... from the Utilities pull
down menu on any Phone Book or the Command pull down menu on any Terminal
Window.
This menu item will cause the Terminal Emulator and phone book to act
EXACTLY as if the AUTOPILOT menu selection was chosen. HOWEVER, there is
NO COMPILE option. Instead of calling AUOTOPILOT, a new program
TT2REXX.EXE is called. This program calls the OS/2 REXXStart function.
The created REXX environment is identical to the environment created when
a REXX COMMAND *.cmd file is typed on the OS/2 command line. There is
NO return value or RC from the REXX program.
If the REXX program issues the PARSE SOURCE function, the word COMMAND
will be returned. If the REXX program queries the ADDRESS function, the
word returned will be the EXT of the REXX (program) file name. For
example:
REXX Program file name = printit.CMD
rc = ADDRESS()
rc is the word CMD
REXX Program file name = printit.REX
rc = ADDRESS()
rc is the word REX
┌──────────────────────────────────┐
│ J.2.2 From A Button Or Keystroke │
└──────────────────────────────────┘
To launch a REXX program from a Terminal Emulator Button or Keystroke,
the following Command may be used in the Assignment field when defining a
Button or Keystroke:
RUN_REXX
This command is identical to the already existing command RUN_SCRIPT.
For example, if you wished to run the REXX program rexxprog.rex, you
would indicate the following Assignment:
RUN_REXX,"rexxprog.rex"
The environment established for REXX is the same as indicated in the
previous section, From The REXX Dialog.
J.3 REXX HLLAPI Function Calls
For more information on REXX hllapi functions refer to the IBM publication:
Extended Services for OS/2
EHLLAPI programming Reference
Doc Number: S04G-1027-xx xx = current revision
Appendix F, REXX EHLLAPI Functions
REMEMBER:
To provide EHLLAPI support for REXX, the module SAAHLAPI.DLL must be
available in the LIBPATH. If you DO NOT have the IBM Communications
Manager installed, refer to the first section of this Appendix,
Overview for more information on how to make it available.
J.4 Sample REXX Program
Below is a sample REXX program which demonstrates how to setup and use
HLLAPi functions from a REXX program.
if RxFuncQuery('hllapi') = 0 then
call RxFuncAdd 'hllapi', 'SAAHLAPI', 'hllapisrv'
rc = hllapi('Connect',sessionID)
if rc <> 0 then do
/* error processing, rc has return code */
end
rc = hllapi('SendKey','LOGON HOSTID')
if rc <> 0 then do
/* error processing, rc has return code */
end
rc = hllapi('Disconnect')
if rc <> 0 then do
/* error processing, rc has return code */
end