Microsoft KB Archive/69111

= Correction for Scroll SUB in GENERAL.BAS, UI Toolbox =

Article ID: 69111

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q69111



SYMPTOMS
The subprogram Scroll within GENERAL.BAS will not display the correct attributes if you select a negative number for &quot;lines&quot; when you want to scroll the window down.



STATUS
A correction for this problem is shown below. (Scrolling in the up direction displays the correct attributes, and needs no correction.)

This correction applies to the User Interface (UI) Toolbox in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS.



MORE INFORMATION
The MS-DOS Interrupt call 16 hex with function 7 or 6 requires that the BX register be set with the color attribute. The bits 6 through 4 are set to the desired background attribute. The following formula shifts this attribute into the correct location in the word register BX: regs.bx = 256 * (attr MOD 8) * 16 The original code for subprogram Scroll has the following attributes set for the BX register: regs.bx = 256 * attr The following excerpt is from Scroll with the correct modifications: SUB Scroll (row1, col1, row2, col2, lines, attr) .         .          .     MAXCOL THEN DIM regs AS RegType IF lines < 0 THEN regs.ax = 256 * 7 + (-lines) 'regs.bx = 256 * attr                <=== old code regs.bx = 256 * (attr MOD 8) * 16  '<=== change to this regs.cx = 256 * (row1 - 1) + (col1 - 1) regs.dx = 256 * (row2 - 1) + (col2 - 1) ELSE regs.ax = 256 * 6 + lines                 'AH = 06 regs.bx = 256 * (attr MOD 8) * 16 regs.cx = 256 * (row1 - 1) + (col1 - 1) regs.dx = 256 * (row2 - 1) + (col2 - 1) END IF       INTERRUPT 16, regs, regs END IF END SUB

Additional query words: BasicCom SR# S910115-118 buglist7.00 buglist7.10

Keywords: KB69111

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.