If you want to attract a user's attention, or you simply want to add some excitement to your programs, the Send Scrolling Message (SNDSCRMSG) command is for you (see Figures 8 and 9). The command sends a, scrolling message at the bottom of the screen with changing colors. Try it, it's fun!
The Send Scrolling Message Command
Figure 8 The SNDSCRMSG Command
/*===============================================================*/ /* To compile: */ /* */ /* CRTCMD CMD(XXX/SNDSCRMSG) PGM(XXX/SCR001CL) + */ /* SRCFILE(XXX/QCMDSRC) */ /* */ /*===============================================================*/ CMD PROMPT('Send Scrolling Message') PARM KWD(MSG) TYPE(*CHAR) LEN(78) MIN(1) + PROMPT('Message')
The Send Scrolling Message Command
Figure 9 CL Program SCR001CL
/*===============================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/SCR001CL) SRCFILE(XXX/QCLSRC) */ /* */ /*===============================================================*/ SCR001CL: + PGM PARM(&MSG) DCL VAR(&MSG) TYPE(*CHAR) LEN(78) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(78) DCL VAR(&COLOR) TYPE(*CHAR) LEN(1) DCL VAR(&COLORS) TYPE(*CHAR) LEN(5) VALUE(X'2022283A38') DCL VAR(&I) TYPE(*DEC) LEN(2 0) DCL VAR(&J) TYPE(*DEC) LEN(2 0) DCL VAR(&K) TYPE(*DEC) LEN(2 0) DCL VAR(&L) TYPE(*DEC) LEN(2 0) /* Do scrolling */ LOOP: + CHGVAR VAR(&I) VALUE(&I + 1) IF COND(&I *EQ 79) THEN(GOTO CMDLBL(END)) CHGVAR VAR(&J) VALUE(79 - &I) CHGVAR VAR(&K) VALUE(&I - 1) IF COND(&I *EQ 1) THEN(CHGVAR VAR(&MSGDTA) VALUE(%SST(&MSG &I &J))) ELSE CMD(CHGVAR VAR(&MSGDTA) VALUE(%SST(&MSG &I &J) *CAT + %SST(&MSG 1 &K))) /* Add some color */ CHGVAR VAR(&L) VALUE(&L + 1) IF COND(&L *EQ 6) THEN(CHGVAR VAR(&L) VALUE(1)) CHGVAR VAR(&COLOR) VALUE(%SST(&COLORS &L 1)) CHGVAR VAR(&MSGDTA) VALUE(&COLOR *CAT &MSGDTA) /* Send the message */ SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&MSGDTA) + TOPGMQ(*EXT) MSGTYPE(*STATUS) GOTO CMDLBL(LOOP) END: + ENDPGM
LATEST COMMENTS
MC Press Online