| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Scrolls a screen region horizontally and/or vertically.
Scroll( [<nTop>] , ;
[<nLeft>] , ;
[<nBottom>], ;
[<nRight>] , ;
[<nRows>] , ;
[<nColumns>] ) --> NIL
The return value is NIL.
Scroll() manipulates the screen display in a console window by moving a rectangular area in horizontal and/or vertical direction. This is accomplished by deleting a row and/or column in scroll direction, shifting the screen area and displaying a blank row and/or column at the end using the standard color. This is repeated until the number of rows and/or columns specified is reached.
Note: if NIL is passed for both, <nRows> and <nColumns>, the entire rectangle defined with <nTop>, <nLeft>, <nBottom> and <nRight> is blanked.
| See also: | @...BOX, @...CLEAR, @...TO, CLEAR SCREEN, RestScreen(), ScrollFixed() |
| Category: | Screen functions |
| Source: | rtl\scroll.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example displays numbers 0 to 50 in a screen area that has only
// ten rows. When the screen cursor hits the bottom of the area, the
// display is scrolled up.
PROCEDURE Main
LOCAL nTop:= 10, nLeft:=10, nBottom:=20, nRight:=20, cScreen
LOCAL nRow, nCol, n
CLS
SET COLOR TO W+/B
DispBox( nTop-1, nLeft-1, nBottom+1, nRight+1 )
SET COLOR TO W+/R
nRow := Row()
nCol := Col()
FOR n := 0 TO 50
@ nRow, nCol SAY n
Inkey(0.1)
nRow ++
IF nRow > nBottom
Scroll( nTop, nLeft, nBottom, nRight, 1 )
nRow := nBottom
ENDIF
NEXT
RETURN
http://www.xHarbour.com