This is likely a simple problem that any of you FP experts can spot immediately. And I will feel stupid, but that is nothing new. I recently tried to upgrade an old TP program that I compiled and ran on a PS2 way back in CS school. But now, at runtime the keyboard fails to display entered keystrokes. I an now running a 5-year-old Compaq. I suspect something simple so I'll skip the architecture details for now. Here goes.....
1. The program opens with:
PROGRAM EVOLUTE(Input, Output, Displayfile, MasterFile);
USES
Crt, Graph;
CONST
MaxPopulation = 4000;
StartPopulation = 800;
TYPE
Person = Array[1..10] of integer;
............ etc....
*****************************************
2. Execution starts in the Main Program:
BEGIN
Assign(DisplayFile,'Display.TXT');
Assign(MasterFile, 'MastFile.TXT');
AssignCrt(Input); Reset(Input);
AssignCrt(Output); Rewrite(Output);
Exit := False;
TextColor(Cyan);
ClrScr;
ShowDisplayFile(1); (* Displays text from a file on the screen *)
TextColor(Yellow);
AMA := Nil;
EndOfPage; (* Problem shows up here *)
TakeInputData; ..........
*******************************************
3. When the running the procedure "EndOfPage", the screenful of text looks
the way it used to, the cursor is the correct color and blinks at the underscore
in the correct position - BUT THE KEYBOARD WILL NOT DISPLAY (OR READ)
WHAT IS TYPED! Grrrrr! Any ideas? The same code ran fine on TP.
Any suggestions would be appreciated. I know I am missing something
simple. Thanks!!!!
Procedure EndOfPage;
VAR
Ch : char;
BEGIN
Ch := ' ';
while (Ch <> 'C') and (Ch <> 'c') do
begin
CursorOn;
GoToXY(60, 25);
Read(Ch);
if (Ch = 'X') or (Ch = 'x') then
begin
If AMA <> nil then (* Memory has been dynamically allocated *)
begin
Dispose(AMA); Dispose(AFA); Dispose(IMA); Dispose(IFA);
end;
TextMode(LastMode);
TextColor(White);
Halt; (* Return to DOS *)
end;
end;
END;