[fpc-pascal]ClrScr problem under Win 2K

J.Scullion at AYRCOLL.AC.UK J.Scullion at AYRCOLL.AC.UK
Fri Feb 28 12:22:24 CET 2003


I'm running VP under Windows 2000, and I can't get ClrScr to work.  The program will compile OK, but when I run it ClrScr has no effect.  Can anyone please help?

Here's an example:

program user_menu;
uses Crt;
var menu_choice:integer;

procedure initialise;
begin
menu_choice:=0;
end;

procedure display_menu;
begin
ClrScr;
writeln('User Menu');
writeln;
writeln;
writeln('First Menu Item           (1)');
writeln;
writeln('Second Menu Item          (2)');
writeln;
writeln('Quit                      (3)');
writeln;
writeln;
writeln;
writeln('Enter the number corresponding to your chosen item');
writeln;
readln(menu_choice);
end;

procedure process_item_one;
begin
ClrScr;
writeln('You heve chosen item one');
writeln;
writeln;
writeln('Press enter to return to the main menu screen');
readln;
end;

procedure process_item_two;
begin
ClrScr;
writeln('You have chosen item two');
writeln;
writeln;
writeln('Press enter to return to the main menu screen');
readln;
end;

procedure get_choice;
begin
if menu_choice= 1 then
        process_item_one
else
if menu_choice=2 then
        process_item_two;
end;

begin
repeat
        display_menu;
        get_choice;
until menu_choice = 3
end.



More information about the fpc-pascal mailing list