Friday, February 29, 2008

Colorized Commands:

These days, virtually everyone knows how to add hex codes in their source code to add color to their source. Examples of hex characters that may be used are x'22' for white or high intensity and x'38' for pink. This same technique works to add color to command prompts.
While creating the source for your command, place a hex character as the first byte of the PROMPT parameter. After compiling the command, you will have colored prompt text within your command. The sample code in shows where to place the hex code (indicated by an x) to colorize your command. Warning: after you enter the hex code in the source, don't prompt on that statement or the entire contents within the prompt parameter will be converted to hex.

CMD PROMPT('x Command Title')
PARM KWD(FLD) TYPE(*CHAR) LEN(10) +
PROMPT('x Input parameter')

No comments: