《RPGIV编程问题百解(6)MODULE vs SERVICE Program》
问题:
I am doing it with a DS (with an external Definition). This is something I have been doing for quite some time to give userkeys a value inside the
program. So I can program something like:
When UserKey = Enter;
ExSr EnterKey;
I have been doing it with a prototype (extpgm) passing a DS and it has always worked great. I am trying to do more ILE so I was trying to put this code into a service program. I am doing exactly the same code but for some reason the service program doesn't put a value into any of the fields when it runs.
Here is more code that I am using.
In main Module:
DKeyDS E DS ExtName(KEYSDS)
.....
// Program to Load User Keys
D LodKey PR
D KeyDs LikeDs(KeyDs)
.....
LodKey(KeyDs);
In the Service Program:
DKeysDS E DS ExtName(KEYSDS)
.....
* Load User Keys
DLodKey PR
D KeyDs LikeDs(KeysDs)
.....
LodKey B EXPORT
DLodKey PI
D KeyDs LikeDs(KeysDs)
/Free
Enter =(X'F1');
PageDn =X'F5';
PageUp =X'F4';
Help =X'F3';
Print =X'F6';
BSpace =X'F8';
Cleark =X'BD';
F1 =X'31';
F2 =X'32';
Exit =X'33';
F4 =X'34';
F5 =X'35';
F6 =X'36';
F7 =X'37';
LookUp =X'38';
F9 =X'39';
F10 =X'3A';
F11 =X'3B';
Cancel =X'3C';
F13 =X'B1';
F14 =X'B2';
F15 =X'B3';
F16 =X'B4';
F17 =X'B5';
F18 =X'B6';
F19 =X'B7';
F20 =X'B8';
F21 =X'B9';
F22 =X'BA';
F23 =X'BB';
F24 =X'BC';
Return;
/End-Free
PLodKey E
提问大体意思:
我用一个moudule实现功能键值定义。在ile环境下,使用这个moudule的程序都可以工作。但是,如果我把这个moudule代码移植到服务应用程序中,就不能返回这个功能键值。
(待续)
阅读(845) | 评论(0) | 转发(0) |