home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / QBAS / WNDTOOL5.ZIP / SCROLL.SUB < prev    next >
Text File  |  1989-04-26  |  4KB  |  83 lines

  1. '
  2. '$PAGE
  3. '
  4. '******************************************************************************
  5. '                    Function :                                               *
  6. '                                                                             *
  7. ' Purpose:                                                                    *
  8. '                                                                             *
  9. '                                                                             *
  10. ' Results:                                                                    *
  11. '                                                                             *
  12. ' Usage  :                                                                    *
  13. '                                                                             *
  14. '                                                                             *
  15. ' Date Written : 01/01/89 - Date Tested: 01/01/89 - Author: James P Morgan    *
  16. ' Date Modified:          -            :          -       :                   *
  17. '-----------------------------------------------------------------------------*
  18. ' NOTE:                                                                       *
  19. '******************************************************************************
  20. '                                                                             *
  21. '     SUB PROGRAM NAME          (PARAMETERS)                 STATIC/RECURSIVE *
  22. '-----------------------------------------------------------------------------*
  23. '                                                                             *
  24. '============================================================================
  25. '
  26. SUB    SCROLL(ULR%,ULC%,LRR%,LRC%,LINES%,DIR%,NEWMSG$)                 STATIC
  27.  
  28.        DEFINT A-Z                               'make all short interger by default
  29.  
  30.        DIM INARRY%(7)                           'array of registers passed to .asm routine
  31.        DIM OUTARRY%(7)                          'array of registers returned from .asm routine
  32.  
  33.        ULR%=ULR%-1                              'Adjust for 0 reference of parameters for BIOS call
  34.        ULC%=ULC%-1
  35.        LRR%=LRR%-1
  36.        LRC%=LRC%-1
  37.  
  38.  
  39. 'Prepare INARRY% variables with data for SCROLL BIOS CALL
  40.  
  41. 'Determine if SCROLL UP (6) or SCROLL DOWN (7) Service
  42.  
  43.        IF     DIR%=1 THEN
  44.            INARRY%(0)=&h0600                  'scroll up
  45.        ELSEIF DIR%=-1 THEN
  46.            INARRY%(0)=&h0700                  'scroll down
  47.        ELSE
  48.            GOTO SCROLL.DONE
  49.        END IF
  50.                                               'Service goes in AH register
  51.        INARRY%(0)=INARRY%(0)+LINES%           'Lines goes in AL register
  52.        INARRY%(1)=SCREEN(ULR%,ULC%,1)*256%    'BH = Color Attribute of window
  53.        INARRY%(2)=(ULR%*256)+ULC%             'CH=ULR, CL=ULC
  54.        INARRY%(3)=(LRR%*256)+LRC%             'DH=LRR, DL=LRC
  55.  
  56.        INARRY%(4)=0                           'All other registers empty
  57.        INARRY%(5)=0
  58.        INARRY%(6)=0
  59.        INARRY%(7)=0
  60.  
  61. 'Perform Scroll
  62.  
  63.        INTRRPT%=&H10                          'Video BIOS Interrupt
  64.  
  65.        CALL INT86(INTRRPT%,VARPTR(INARRY%(0)),VARPTR(OUTARRY%(0)))
  66.  
  67. 'Determine if NEWMSG$ goes on top or bottom line
  68.        IF     DIR%=1 THEN
  69.            ROW%=LRR%+1                        're-adjust references
  70.        ELSEIF DIR%=-1 THEN
  71.            ROW%=ULR%+1
  72.        END IF
  73.  
  74.        COL%=ULC%+1                            're-adjust references
  75.  
  76.        ATTR%=SCREEN(ULR%,ULC%,1)              'get the attribute currently on the screen
  77.  
  78.        CALL FASTPRT(NEWMSG$,ROW%,COL%,ATTR%)
  79.  
  80. SCROLL.DONE:
  81.        EXIT SUB                               'return to caller
  82. END SUB
  83.