home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / qb_sub / scroll.sub < prev    next >
Encoding:
Text File  |  1987-07-14  |  5.1 KB  |  139 lines

  1. '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. '%  (C) 1987 HUMBLEWARE Custom Programming    Author: Lawrence A. Westhaver  %
  3. '%        247 Paul Martin Drive,  Baltimore MD  21227  (301) 799-1975        %
  4. '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  5. '%                                                                           %
  6. '%     FILENAME: SCROLL.SUB                      LAST UPDATE: 05-24-1987     %
  7. '%                                                                           %
  8. '%  DESCRIPTION: Two subroutines that allow you to scroll a specified area   %
  9. '%               of the screen either up or down:                            %
  10. '%                                                                           %
  11. '%         CALL: CALL SCROLLxx(LINES%,ATTR%,TOP%,LFT%,BOT%,RGT%)             %
  12. '%                                                                           %
  13. '%                 SCROLLUP: Scrolls the defined area upward.                %
  14. '%                                                                           %
  15. '%                 SCROLLDN: Scrolls the defined area downward.              %
  16. '%                                                                           %
  17. '%       INPUTS: LINES% = The number of screen lines to scroll. If set to    %
  18. '%                        zero, the defined area will be blanked.            %
  19. '%                                                                           %
  20. '%               ATTR%  = The attribute used to fill the lines emptied by    %
  21. '%                        the scroll.                                        %
  22. '%                                                                           %
  23. '%               TOP%   = The top row of the area to scroll.                 %
  24. '%                                                                           %
  25. '%               LFT%   = The left column of the area to scroll.             %
  26. '%                                                                           %
  27. '%               BOT%   = The bottom row of the area to scroll.              %
  28. '%                                                                           %
  29. '%               RGT%   = The right column of the area to scroll.            %
  30. '%                                                                           %
  31. '%      OUTPUTS: None.                                                       %
  32. '%                                                                           %
  33. '%         NOTE: This routine uses the same row and column ranges as the     %
  34. '%               QuickBASIC "LOCATE row,col" statement, where: row=(1-25)    %
  35. '%               and col=(1-80), these ranges are automatically converted    %
  36. '%               to the IBM BIOS ranges: row=(0-24) and col=(0-79).          %
  37. '%                                                                           %
  38. '%               The Microsoft QuickBASIC INT86 assembly routine must be     %
  39. '%               linked into your program at compile time or it must be      %
  40. '%               present in the QuickBASIC USERLIB.EXE file before this      %
  41. '%               routine can be used.                                        %
  42. '%                                                                           %
  43. '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  44.  
  45.  
  46. SUB SCROLLUP(LINES%,ATTR%,TOP%,LFT%,BOT%,RGT%) Static
  47.  
  48.  
  49. 'dim parameter storage for INT86 call
  50.  
  51.     DIM PARMIN%(7),PARMOUT%(7)
  52.  
  53.  
  54. 'declare indexes for INT86 calls
  55.  
  56.     AXREG%=0    'AX register
  57.     BXREG%=1    'BX register
  58.     CXREG%=2    'CX register
  59.     DXREG%=3    'DX register
  60.     BPREG%=4    'BP register
  61.     SIREG%=5    'SI register
  62.     DIREG%=6    'DI register
  63.     FLAGS%=7    'Flags
  64.  
  65.  
  66. 'adjust row and column variables down by 1
  67.  
  68.     TOP%=TOP%-1
  69.     LFT%=LFT%-1
  70.     BOT%=BOT%-1
  71.     RGT%=RGT%-1
  72.  
  73.  
  74. 'scroll window up
  75.  
  76.     POKE VARPTR(PARMIN%(AXREG%))+0,LINES%
  77.     POKE VARPTR(PARMIN%(AXREG%))+1,&H06
  78.  
  79.     POKE VARPTR(PARMIN%(BXREG%))+1,ATTR%
  80.  
  81.     POKE VARPTR(PARMIN%(CXREG%))+0,LFT%
  82.     POKE VARPTR(PARMIN%(CXREG%))+1,TOP%
  83.  
  84.     POKE VARPTR(PARMIN%(DXREG%))+0,RGT%
  85.     POKE VARPTR(PARMIN%(DXREG%))+1,BOT%
  86.  
  87.     CALL INT86(&H10,VARPTR(PARMIN%(0)),VARPTR(PARMOUT%(0)))
  88.  
  89.  
  90. END SUB 'scrollup
  91.  
  92.  
  93.  
  94. SUB SCROLLDN(LINES%,ATTR%,TOP%,LFT%,BOT%,RGT%) Static
  95.  
  96.  
  97. 'dim parameter storage for INT86 call
  98.  
  99.     DIM PARMIN%(7),PARMOUT%(7)
  100.  
  101.  
  102. 'declare indexes for INT86 calls
  103.  
  104.     AXREG%=0    'AX register
  105.     BXREG%=1    'BX register
  106.     CXREG%=2    'CX register
  107.     DXREG%=3    'DX register
  108.     BPREG%=4    'BP register
  109.     SIREG%=5    'SI register
  110.     DIREG%=6    'DI register
  111.     FLAGS%=7    'Flags
  112.  
  113.  
  114. 'adjust row and column variables down by 1
  115.  
  116.     TOP%=TOP%-1
  117.     LFT%=LFT%-1
  118.     BOT%=BOT%-1
  119.     RGT%=RGT%-1
  120.  
  121.  
  122. 'scroll window down
  123.  
  124.     POKE VARPTR(PARMIN%(AXREG%))+0,LINES%
  125.     POKE VARPTR(PARMIN%(AXREG%))+1,&H07
  126.  
  127.     POKE VARPTR(PARMIN%(BXREG%))+1,ATTR%
  128.  
  129.     POKE VARPTR(PARMIN%(CXREG%))+0,LFT%
  130.     POKE VARPTR(PARMIN%(CXREG%))+1,TOP%
  131.  
  132.     POKE VARPTR(PARMIN%(DXREG%))+0,RGT%
  133.     POKE VARPTR(PARMIN%(DXREG%))+1,BOT%
  134.  
  135.     CALL INT86(&H10,VARPTR(PARMIN%(0)),VARPTR(PARMOUT%(0)))
  136.  
  137.  
  138. END SUB 'scrolldn
  139.