Hello, everyoneworking out quite well, and the potential synergy is bubbling up, just waiting to be discovered.
Regina REXX is being built into GnuCOBOL as an Intrinsic Function. It is
This build is currently a side branch of the main GnuCOBOL development tree.It will likely be folded into GnuCOBOL proper shortly after the official release of GnuCOBOL 2.2. (We'll be releasing GnuCOBOL 2.0-rc3, officially as GnuCOBOL 2.2 soon).
Implemented as two functions, rexx() and rexx-restricted() (which turns onthe Regina RXRESTRICTED feature to disable many of the more dangerous powers of
As an intrinsic function the feature allows for code such asrestricted script'")
display rexx-restricted("return 6 * 7")
----
display rexx-restricted("address system 'rm *.important'; return 'No delete,
----
01 cobol-field pic x(64).
move rexx("parse version info; return info") to cobol-field
display trim(cobol-field)
----
01 answer usage binary-long.
compute answer = numval(rexx("return 6 * arg(1)", 6)) + 6
display answer
----
REPLACE ==newline== BY ==& x'0a' &==.
01 rexx-result pic 9(5).
move rexx(
"sum = 0" newline
"do i = 1 to 10" newline
" sum = sum + i" newline
" say sum" newline
"end" newline
"return sum + arg(1)", 127)
to rexx-result
display rexx-result
----
01 shared-value pic x(6).
display rexx("a = arg(1); say 'Got: ' a; push a; return 'a pushed'", "abc") move rexx("pull a; return a || 'def'") to shared-value
display shared-value
With judicious use of character data concatenation in COBOL, upto 8K ofscript (default configuration) can be passed into rexx() or rexx-restricted().
The first argument is the REXX script, followed by up to 32 optionalarguments passed to REXX as ARG(n) values. The 32 limit can be changed and is dependent on compile time and runtime configurations. The function return field is effectively an any length COBOL character data field (just like other alphanumeric intrinsic functions).
The beta defines one EXTERNAL data item that provides access to the REXX APIreturn code. Currently, as each rexx() invocation is a separate interpreter, shared values between scripts use the push pull features of the internal Regina
Specially crafted COBOL modules, that code to the SAA REXX external functionAPI are proven, and there is a rxfuncadd sample in the Intrinsic REXX tips and tricks thread that is accumulating in the GnuCOBOL SourceForge project space. This is where programmable COBOL applications start to shine through. A GCI sample should be posted shortly, making it even easier to expose COBOL programs
https://sourceforge.net/p/open-cobol/discussion/cobol/thread/2b41632f/for now is still in a branch of the source repository and will require building
Design and development notes are being discussed in a Contributions thread at
https://sourceforge.net/p/open-cobol/discussion/contrib/thread/c31cd4d6/
SVN repository with download instructions at
https://sourceforge.net/p/open-cobol/code/HEAD/tree/branches/gnu-cobol-builtin-script/
This will soon be part of the mainline GnuCOBOL release tarball/zip file, but
Leverage REXX directly from COBOL source, and provide easy access to COBOLmodules for end user scripting.
This is all free software, with GNU LGPL COBOL runtime and Regina REXXlicensed under the GNU LGPL as well.
If you try it, feel free to drop questions and opinions in the GnuCOBOLdiscussion groups on SourceForge. Documentation will be accumulating in the GnuCOBOL FAQ at
https://open-cobol.sourceforge.io/faq/index.html#intrinsic-rexx
This announcement is being posted to both comp.lang.rexx and comp.lang.cobol.
Have good, make well,
Brian
Is there ANY chance at all that GnuCOBOL will be supporting OO COBOLI'm going to go out on the limb and say Yes, Peter, there is a high non-zero chance that GnuCOBOL will support Object COBOL someday. We are on GnuCOBOL 2.0-rc3, expecting Simon to sign off on a GnuCOBOL 2.2 release tarball shortly.
and/or Component Object Model (COM) interface, at ANY time in the future?
Cheers,
Pete.
--
I used to write COBOL; now I can do anything...
chance that GnuCOBOL will support Object COBOL someday.
Is there ANY chance at all that GnuCOBOL will be supporting OO COBOL
and/or Component Object Model (COM) interface, at ANY time in the future?
Cheers,
Pete.
--
I used to write COBOL; now I can do anything...
I'm going to go out on the limb and say Yes, Peter, there is a high non-zero
Hello, everyoneworking out quite well, and the potential synergy is bubbling up, just waiting to be discovered.
Regina REXX is being built into GnuCOBOL as an Intrinsic Function. It is
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,004 |
Nodes: | 10 (0 / 10) |
Uptime: | 221:08:29 |
Calls: | 13,080 |
Calls today: | 1 |
Files: | 186,574 |
Messages: | 3,300,356 |