Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_scrolltextwindow() scroll current text window</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _scrolltextwindow()     Scroll current text window

 #include   <graph.h>

 void _scrolltextwindow(lines);
 short lines;             Number of lines to scroll

    _scrolltextwindow() scrolls the current window. If lines is > 0,
    the window scrolls up; < 0 and the window scrolls down. Scrolling
    by more lines than the window holds is the same as clearing the
    window.

 Portability:   Not supported by the ANSI standard.

   -------------------------------- Example ---------------------------------

        This program scrolls the screen in different places:

    #include <stdio.h>
    #include <conio.h>
    #include <graph.h>

    void main()
    {
        short scrow, mleft, mtop, mright, mbot;
        struct rccoord rcstruc;

        _clearscreen(_GCLEARSCREEN);
        for(scrow = 1; scrow <= 20; scrow++)
        {
            _settextposition(scrow, 1);
            printf("Hello. This is line %d", scrow);
        }
        getch();

        _settextwindow(1, 1, 25, 8);
        _scrolltextwindow(-5);
        getch();

        _settextposition(5, 1);
        rcstruc = _gettextposition();
        _gettextwindow(&mtop, &mleft, &mbot, &mright);
        _settextwindow(rcstruc.row, mleft, mbot, mright);
        _scrolltextwindow(_GSCROLLUP);
        getch();

        _setvideomode(_DEFAULTMODE);
    }

See Also: _gettextposition() _outtext() _settextposition() _settextwindow()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson