星期二, 10月 31, 2023

2001-06-13 如何加入告示板移動式訊息(Scrolling Message)於應用軟體中?



如何加入告示板移動式訊息(Scrolling Message)於應用軟體中?

File  : QDDSSRC
Member: BILLBOARDD
Type  : DSPF

     A                                      DSPSIZ(24 80 *DS3)
     A                                      MSGLOC(24)
     A                                      PRINT
     A                                      CA03(03 'EXIT PROGRAM')
     A          R WAITMSG
     A                                      ASSUME
     A                                      KEEP
     A                                      OVERLAY
     A                                      FRCDTA
     A            @MSG          79A  O 24  2
     A                                      DSPATR(HI)
     A  22                                  DSPATR(RI)
     A  22                                  COLOR(GRN)
     A          R DUMMY                     ASSUME
     A                                  1  3' '




File  : QRPGLESRC
Member: BILLBOARDR
Type  : RPGLE

     F*****************************************************************
     F*                                                               *
     F* OPTION BILLBOARD                                              *
     F*                                                               *
     F*****************************************************************
     F*                                                               *
     F* BILLBOARDR- DISPLAY A MESSAGE IN THE MESSAGE LINE AS A        *
     F*             BILL BOARD                                        *
     F*                                                               *
     F*       BY  - Vengoal Chang                                  *
     F*                                                               *
     F*****************************************************************
     F*                                                               *
     F* FILES USED:                                                   *
     F*  BILLBOARDD- DISPLAY FIUE                                      *
     F*   FORMATS - DATAFOOT, WAITMSG                                 *
     F*                                                               *
     F*****************************************************************
     F*
     FBILLBOARDDO    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 I               S              2  0
      *
     C*
     C*----------------------------------------------------------------
     C* @TIMES -> repeat display scrolling message number times
     C     *ENTRY        PLIST
     C                   PARM                    @NOTE            79
     C                   PARM                    @TIMES            2 0
     C*
     C*  EXECUTE SUBROUTINE OPTBB
     C*

     C                   Eval      NOTE = @NOTE

     C                   For       I = 1 to @TIMES
     C                   EXSR      OPTBB
     C                   EndFor

     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#(81)
     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                   MOVE      '1'           *IN22
     C                   WRITE     WAITMSG
     C                   END
     C                   MOVE      '0'           *IN22
     C                   MOVE      *BLANKS       @MSG
     C                   ENDSR
     C*----------------------------------------------------------------
**
DLYJOB DLY(3)
**




File  : QDDSSRC
Member: BILLBOARDT
Type  : RPGLE Sample Program

     F*****************************************************************
     F*                                                               *
     F* OPTION BILLBOARD  Sample Program                              *
     F*                                                               *
     F*****************************************************************
     F*
     D NOTE            S             79    inz('This is Scrolling Message!')
     D
     C                   Eval      @NOTE = NOTE
     C                   Call      'BILLBOARDR'
     C                   PARM                    @NOTE            79
     C                   PARM      2             @TIMES            2 0

     C                   Move      '1'           *InLr
     C*



沒有留言: