Metropoli BBS
VIEWER: progp010.pas MODE: TEXT (ASCII)
{/************************************************************************/}
{/* Scroll in a loop by one pixel at a time				*/}
{/* Scroll using arrow keys and quit if Escape is pressed		*/}
{/************************************************************************/}

procedure smooth_horizontal;
const
KEY_ESC = $1B;
KEY_UP = 78;
KEY_DOWN = 80;
KEY_LEFT = 75;
KEY_RIGHT = 77;
KEY_ENTER = $0D;
var
x : integer;
i : integer;
k : integer;
key : char;
begin
    x := 0;
    i := 0;
    set_more_columns(100); {/* Select 100 text column mode	       */}
    for i := 0 to 24 do {/* Fill newly organized text buffer	*/}
        writeln('This is text line ',i,' in the new text buffer');
    key := readkey;
    k := integer(key);
    while k <> KEY_ENTER do begin
        case k of
	    KEY_RIGHT: if x < 800 then x := x+1;	{/* Scroll right */}
	    KEY_LEFT:  if x > 0 then x := x-1;	{/* Scroll left	*/}
	    end;
        horizontal_scroll(x);
        key := readkey;
        k := integer(key);
    end;
    horizontal_scroll(0);
end;
[ RETURN TO DIRECTORY ]