Overrule Function Key script

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
Theo de Bruin
Posts: 5
Joined: 02 Nov 2017, 01:04

Overrule Function Key script

Post 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?
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

Re: Overrule Function Key script

Post by Dino »

Hi Theo

Having this code in the OnLeave for the Screen worked for me:
axescallpgm1.png
axescallpgm1.png (84.84 KiB) Viewed 13853 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.
Theo de Bruin
Posts: 5
Joined: 02 Nov 2017, 01:04

Re: Overrule Function Key script

Post 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
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

Re: Overrule Function Key script

Post 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,
Post Reply