Page 1 of 1
Overrule Function Key script
Posted: 23 May 2023, 18:30
by Theo de Bruin
I want to overrule the usage of a certain Function key by using a script
e.g. like this (only this does not work )
IF ( ENV.key == "F20" ) {CALL MYPROG PARM('PARM1' 'PARM1'')}
Any suggestions how to do this with the corerct syntax?
Re: Overrule Function Key script
Posted: 24 May 2023, 01:19
by Dino
Hi Theo
Having this code in the OnLeave for the Screen worked for me:

- axescallpgm1.png (84.84 KiB) Viewed 13852 times
Code: Select all
if (ENV.key == "F4") {
TABLEMANAGER.callProgram("CLTEST","G14TEMP",
{type:"alpha",len:10,value:"QGPL "} );
ENV.key === null;
}
and the test code for my CL (G14TEMP/CLTEST) was:
Code: Select all
PGM PARM(&LIB)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)
DSPLIB LIB(&LIB) OUTPUT(*PRINT)
ENDPGM
but remember that the Call will be executed "in parallel/submitted" by another job, in the aXes subsystem, under the aXes user, not in this job/interactive/session.
The ENV.key === null; is effectively stopping the key to be sent to the 5250 session.
Re: Overrule Function Key script
Posted: 24 May 2023, 20:07
by Theo de Bruin
Hi Dino,
Thank you for this solution, but this only for AxesW3, and not for AxesJSM ?
As I'm getting this error when using AxesJSM
AXES.TableManager._oncallProgramOK: Error trapped - Attempt to invoke /agi/lua5/extservice_6.lua failure trapped by _oncallProgramFail
Should we then need to use the connector.call extension in Axes instead?
Regards,
Theo
Re: Overrule Function Key script
Posted: 25 May 2023, 01:15
by Dino
Hi Theo,
Yes, if JSM, then instead of the:
Code: Select all
TABLEMANAGER.callProgram("CLTEST","G14TEMP",
{type:"alpha",len:10,value:"QGPL "} );
you will need to use the connector call. I do not have a working example using that...
if you get one running, please share.
kind regards,