The Send Scrolling Message Command

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: