home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
ckc190.tar.gz
/
ckc190.tar
/
ckorexx.doc
< prev
next >
Wrap
Text File
|
1994-06-19
|
4KB
|
113 lines
OS/2 C-KERMIT'S REXX INTERFACE EXPLAINED
Jeffrey Altman, Altmania Productions and Seer Technologies
<p00118@psilink.com>
February 8, 1994
Updated 23 Apr 94 (See the end of this file for info about VX-REXX)
And 1 Jun 94 (CKCOMMAND and REXXFILE commands removed)
Why would you want to use Rexx from within C-Kermit?
* Easier to use math functions
* Want to run a Rexx program but don't want the overhead of starting a
command shell
* Want to have access to additional OS/2 specific functionality (i.e.
Create WPS objects, perform directory searchs, ...)
* Want to add your own functions to the C-Kermit script language
There are three types of functionality provided in the C-Kermit/Rexx interface:
* ability to execute a Rexx command line
* ability to execute a Rexx command file
* ability to call C-Kermit commands from a Rexx program (while
executing under C-Kermit)
--------------------
Let's say you want to execute a one-line Rexx program from within
C-Kermit. You would use the new C-Kermit "rexx" command. The format
of the command is:
rexx <rexx command>
where <rexx command> is everything after the keyword "rexx" to the end
of the line. A simple example:
rexx say "hello"
will execute the rexx command SAY with the parameter "hello". "hello"
will now be printed on your screen.
Another example, returning a value from rexx.
rexx return 4 * 4
the rexx command "return 4 * 4" will calculate the value "16" and then
return it to C-Kermit. C-Kermit stores the return value from the last
Rexx command in \v(rexx).
Let's say you want to execute a series of rexx commands, but don't want
to create a file.
rexx say "hello"\13 return 0
This will print the string "hello" and then return the value "0" to
C-Kermit. Notice that \13 (^M) was placed between the commands. This
is necessary because rexx expects to find each command separated by a
return character just as if it was being read from a file.
---------------------
To execute a REXX command file, use:
C-Kermit> rexx call oofa.cmd
(where "oofa.cmd" is the name of your REXX command file).
---------------------
Now let's say that you have this really great Rexx program, and you want
to be able to gain access to a C-Kermit variable value, change a
C-Kermit setting, or execute a C-Kermit command. You could alter your
program so that it is called in separate parts from a C-Kermit take
file or macro. But we have a better way. Just include the C-Kermit
command in your Rexx program.
For instance, you want to set the parity from within your Rexx program:
/* beginning of rexx program file */
parity = "None"
set parity parity
will result in C-Kermit setting the parity to "None"
Let's say we want to set a Rexx variable to that of a C-Kermit
variable. Here is how we would do it:
parity = '\v(parity)'
Notice the quotes around the C-Kermit statement. This tells Rexx to pass
the statement to C-Kermit for evaluation before performing the assignment.
--------------------
Q: What happens if you create a Rexx program file that contains C-Kermit
commands and you try to execute it outside of the C-Kermit environment?
A: A Syntax Error.
This is because the C-Kermit commands are only available when C-Kermit is
executing the Rexx command file.
Q: Can C-Kermit be used with Rexx programming tools such as Watcom's
VX-REXX?
A: Yes and No.
C-Kermit and VX-REXX work together too. To run a VX-REXX program from
within C-Kermit, first generate a .VRM file and then invoke it with the
C-Kermit REXX CALL command. However, the VX-REXX program is not allowed
to make Presentation Manager calls, because VIO applications (like C-Kermit)
can't do that.
(End of CKOREXX.DOC)