Easily Create Help Text For Commands
January 23, 2013 Ted Holt
|
Extending IBM i by writing one’s own commands is empowering and gratifying, but a command without help text is like scrambled eggs without salsa. Fortunately, generating help text for a command is easy, thanks to a technique I learned from a very talented programmer named Chris Wages. Let me show you how it’s done. First, you must have a command, of course. Here’s the source code for command DOIT.
CMD PROMPT('Do it')
PARM KWD(HOW) TYPE(*CHAR) LEN(7) RSTD(*YES) +
DFT(*WELL) +
VALUES(*WELL *BETTER *BEST) +
EXPR(*YES) +
PROMPT('How should I do it?')
PARM KWD(WHEN) TYPE(*CHAR) LEN(8) RSTD(*YES) +
DFT(*MORNING) +
VALUES(*MORNING |


