Problem solve Get help with specific problems with your technologies, process and projects.

Display a scrolling message in your RPG application

Here is a way to catch a user's attention with a scrolling message in the message window of your RPG application.

Here is a way to catch a user's attention with a scrolling message in the message window of your RPG application. Just insert this routine into your RPG program as well as the record formats from the corresponding display file. Compile the DDS and RPG source and you are ready for testing.

The message scrolls from the right, pauses with the message highlighted, and then scrolls off of the screen to the left.


 
     F*****************************************************************
     F*                                                               *
     F* OPTION BILLBOARD                                              *
     F*                                                               *
     F*****************************************************************
     F*                                                               *
     F* BILLBOARD - DISPLAY A MESSAGE IN THE MESSAGE LINE AS A        *
     F*             BILL BOARD                                        *
     F*                                                               *
     F* DATE WRITTEN - 06/01/01                                       *
     F* WRITTEN BY   - D.BEECH                                        *
     F*                                                               *
     F*****************************************************************
     F*                                                               *
     F* FILES USED:                                                   *
     F*  BILLBORD - DISPLAY FIUE                                      *
     F*   FORMATS - DATAFOOT, WAITMSG                                 *
     F*                                                               *
     F*****************************************************************
     F*
     FBILLBORD  O    E             WORKSTN INFDS(WORKS)
     D*
     D CMD1            S             13    DIM(1) CTDATA PERRCD(1)
     D NOTE            S             79    DIM(1) CTDATA PERRCD(1)		
     D OP#             S              1    DIM(160)                           
     D*
     D WORKS           DS
     C*
     C*----------------------------------------------------------------
     C*
     C     *ENTRY        PLIST
     C                   PARM                    @NOTE            79
     C*
     C*  EXECUTE SUBROUTINE OPTBB 
     C*
     C                   EXSR      OPTBB
     C                   MOVE      '1'           *INLR
     C                   RETURN
     C*
     C*----------------------------------------------------------------
     C*  OPTION BILLBOARD DISPLAY MESSAGE ROUTINE
     C*----------------------------------------------------------------
     C*
     C     OPTBB         BEGSR
     C                   CLEAR                   OP#
     C                   Z-ADD     13            LEN1             15 5
     C                   MOVE      *BLANKS       @MSG             79
     C                   MOVEL     NOTE(1)       @MSG
     C                   MOVEA     @MSG          OP#(81)
     C     1             DO        81            X                 2 0
     C                   MOVEA     OP#(X)        @MSG
     C*
     C* DO LOOP TO SLOW DOWN THE DISPLAY MESSAGE
     C*
     C     1             DO        30000         Y                 5 0
     C                   END
     C                   WRITE     WAITMSG
     C                   END
     C                   MOVE      '1'           *IN22
     C                   WRITE     WAITMSG
     C*
     C* CALL 'QCMDEXC' WITH THE CLP COMMAND DLYJOB FOR 3 SECONDS
     C*
     C                   CALL      'QCMDEXC'
     C                   PARM                    CMD1
     C                   PARM                    LEN1
     C                   MOVE      '0'           *IN22
     C                   CLEAR                   OP#
     C                   MOVEA     @MSG          OP#(1)
     C     1             DO        81            X
     C                   MOVEA     OP#(X)        @MSG
     C*
     C* DO LOOP TO SLOW DOWN THE DISPLAY MESSAGE
     C*
     C     1             DO        30000         Y
     C                   END
     C                   WRITE     WAITMSG
     C                   END
     C                   MOVE      *BLANKS       @MSG	
     C                   ENDSR
     C*----------------------------------------------------------------
**
DLYJOB DLY(3)
**
Here is a message using the option billboard routine courtesy of SEARCH400.COM.
**********************Display File BILLBORD for Option Billboard ************
     A*%%TS  SD  20010321  080458  ISDWIGHT    REL-V4R4M0  5769-PW1
     A*  92/03/26  11:56:40    ISDWIGHT    REL-R03M00  5728-PW1
     A*%%EC
     A                                      DSPSIZ(24 80 *DS3)
     A                                      REF(*LIBL/BFFLDREF)
     A                                      MSGLOC(24)
     A                                      PRINT
     A                                      CA03(03 'EXIT PROGRAM')
     A          R WAITMSG
     A                                      LOCK
     A                                      FRCDTA
     A                                      CLRL(*NO)
     A            @MSG          79A  O 24  2
     A                                      DSPATR(HI)
     A  22                                  DSPATR(RI)
     A  22                                  COLOR(GRN)

Dig Deeper on iSeries CL programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close