On 24/06/2021 9:44 pm, Jeremy Nicoll wrote:
On Thu, 24 Jun 2021, at 01:57, David Crayford wrote:
For example, to create and ISPF in Lua you instantiate and ISPF object
and then communicate with it by calling methods
https://lua4z.github.io/Lua4z/modules/ispf.html.
That shows eg that you can invoke ispf edit via lua. But can you use lua
to tell ispf edit to run a macro (written in lua) and can that macro issue
ispf editor commands, and also display ispf panels (eg to find out what
the macro should do or display its results) and issue tso commands?
Yes to all. Here's an example. The 'ispf.bind' function uses VDEFINE to
map ISPF variables to the vars table.
local ispexec = ispf.ispexec
local isredit = function (cmd) return ispexec("ISREDIT " .. cmd) end
isredit "RESET"
isredit "(LRECL) = LRECL"
local lrecl = ispf.vcopy("LRECL")
local vars = ispf.bind {
{ "dsname", "char", 44},
{ "member", "char", 8},
{ "line", "charbuf", lrecl},
{ "linenum","char", 30},
}
isredit "RESET"
isredit "(DSNAME) = DATASET"
isredit "(MEMBER) = MEMBER"
To run a TSO command and print the output
for line in tso.exec("HELP ALLOC") do
print(line)
end
How about replacing REXX in eg Netview?
Does Netview support C/C++? If so then yes as Lua is designed to be
embedded in C/C++ applications. That's why it's the goto language for
video game scripting.
It runs in CICS just fine just by launching a script from a C++ program.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN