DEV02 - Extending Applications with REXX
Christian Langanke for
netlabs.org
Overview
Script Language REXX
REXX integration in eComStation
Extending REXX with external libraries
Extending Applications with REXX
More advanced Extensions to REXX
Script Language REXX
Interpreted Programming Language
Classic REXX is part of OS/2 1.2 and newer
Object Oriented REXX (OOREXX) superseeds Classic REXX
part of OS/2 Warp 4 and better
not active by default, switch with switchrx.cmd and reboot
mostly compatible to Classic REXX (minor incompatibility in few functions
Exists for other platforms such as MVS, AIX, Windows, Linux
OOREXX is Open Source (see www.oorexx.org)
Alternative implementations: e.g. Regina REXX
REXX integration in eComStation
Integration by Command Processor CMD.EXE
Batch files with Comment Header are passed to REXX interpreter
Tokenized version of scripts stored as extended attributes
Set of system-near APIs available as Sys* REXX function library
several Sys-APIs for creating, deleting and modifying Workplace Shell Objects
Extending REXX - External Libraries
external functions loadable via DLL interface
prominent sample: REXXUTIL.DLL with Sys* function
load DLL with
RxFuncAdd
call added functions like internal REXX functions
many external DLLs available, see overview in INF file of
REXX Tips and Tricks
external code accesses the REXX Variable Pool via
RexxVariablePool
read values from/ pass values to REXX Script
Extending Applications with REXX 1/3
REXX interpreter is called by applications with
RexxStart
Applications may provide a context, which can be selected by REXX function ADDRESS
REXX Commands not resolved or explicitely put in quotes are passed to the application context
Example: eComStation Commands to the Command Processor CMD.EXE, defining the context CMD
Extending Applications with REXX 2/3
Applications add variables to or read variales from the REXX variable pool by
registering an exit handler for the initialization with
RexxRegisterExitExe/Dll
within the handler add values to the variable pool with
RexxVariablePool
Example: Script Engine of
Wireless LAN Monitor
script is called on events like connect and disonnect
variables like network name and TCP/IP configuration values are passed to the script
Extending Applications with REXX 3/3
Applications register a subcommand handler with
RexxRegisterSubcomExe/Dll
to establish a context.
Example: DFSee
script is called by DFSee - specified on commandline
Context name is
DFS
DFSee related commands are included in the REXX script and passed to the subcommand handler of DFSee
More advanced Extensions to REXX
Create REXX Queues from external code and exchange data by these
add REXX functions to the Macro Space
Register a System Exit handler with
RexxRegisterExitExe/Dll
to intercept
initialization or termination of REXX interpreter
call of external functions
textmode input and output
access to external data queues
REXX events like HALT or TRACE
The End
Thank you very much for your your attention!