954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Simple Crt module examples for color

0
By Erik Anderson on Dec 14th, 2010 9:27 am

Using FPS IDE with FPC compiler on windows xp.

program PrettyConsole;
uses
    Crt;
var
    x : integer;
begin
    Window(1, 1, 10, 5);// start x, start y, width, height
    TextBackground(Blue);
    ClrScr;//now box screen is blue
    Readln;
    Window(1, 1, 80, 25);//default cmd screen size on my comp
    ClrScr;
    ReadLn;
    for x := 1 to 16 do
    begin
        Window(1, 1, 80, 25);//just me being carefull
        TextBackground(x);// might be more or less than 16, idk just found 16
                          //options on fpc documentation of crt module
        ClrScr;
        ReadLn;
    end;
    Window(1, 1, 80, 25);
    TextBackground(Black);
    TextColor(White);
    WriteLn('End of colorful fun :(');
    ReadLn;
    ReadLn;
end.

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: