![[Toc]](../../toc.gif)
![[Index]](/idx.gif)
"Compiling" REXX programs
I don't know of a real REXX compiler for OS/2 REXX. But because the REXX
interpreter stores an tokenized copy of each REXX program in the EAs of
the program, it is possible to delete the source code from REXX programs
(see REXXCC). Another method to "compile" a REXX program is used by the
program RxCLS ($). But this is also no real compiler.
The only method to create a standalone REXX program that runs on any
machine with or without REXX installed is to create an EXE containing the
REXX program and a static version of a REXX interpreter.
This is possible with the package Rexx/Wrapper and the REXX Interpreter
Regina from Mark Hessling (see Internet - Web Pages)
To "compile" an Object-Oriented REXX program you can use the program
REXXC.EXE which is part of Object-Oriented REXX. REXXC.EXE creates the
token image and saves it in a REXX cmd. This method avoids the 64 K limit
for the token image. (see also the Creating "compiled" programs for
Classic REXX and Object REXX)
Another method to create a token image of your REXX program is to load the
REXX program into the macro space and save the macro space into a file.
This will produce a token image of your REXX program that you can reload
into the macrospace and execute it from there. This method also avoids the
64 K limit of the EAs. (see REXXCC - a REXX "compiler")
In this case you need an additional loader to load the token image into
the macro space again before you can execute it.
Or use LoadMac.cmd to create and laod the token image:
REM *** Create the token image
LOADMAC CLEAR ADD:myProg.CMD SAVE:myProg.IMG
REM *** Load the image into the REXX macro space
LOADMAC CLEAR LOAD:MyProg.IMG
REM *** Execute the image
REXXTRY call myprog myparms
REM *** Drop the image from the REXX macro space
LOADMAC DROP:MyProg
REM *** or (if the image contains more than one macro)
LOADMAC CLEAR
see also Debugging a "compiled" REXX program, Get the source code of a
"compiled" REXX program, and Protect the source code of a REXX program
Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs