Hi Everyone,
From my RPG ILE program, when I press F4, I want to have a Command Prompt screen similar to as if I typed CALL then F4 from the command line.
What should I do to accomplish this?
Thank you in advance.
Lap Nguyen
Software/Hardware used:
ASKED:
February 25, 2008 11:40 PM
UPDATED:
February 27, 2008 11:01 PM
One thing that you can do is use to prototypes:
To prompt the command use the follwoing:
d Cmd S 2000A
d ChkCmd PR ExtPgm(‘QCMDCHK’)
d CmdString 2000A
d CmdStringLen 15P 5 Const
d CmdOption 3A Const Options(*NoPass)
/free
Cmd = ‘?’ + %Trim(W$OBJCMD);
CallP(E) ChkCmd(Cmd:%Len(Cmd));
/end-free
the W$OBJCMD contains an AS/400 command with parameters, ect.
When the call is done, you can use the following:
d Command S 2000A Inz Varying
d ExecCmd PR ExtPgm(‘QCMDEXC’)
d CmdString 3000A Const Options(*VarSize)
d CmdStringLen 15P 5 Const
d CmdOption 3A Const Options(*NoPass)
/free
Command = Cmd
CallP(E) ExecCmd(Command:%Len(Command));
/end-free
This should allow you to place a command the CMD field; use the CHKCMD prototype, and then use that string that is returned to initiate a call to the processor on the 400.
-Joe-