Programs to Debug: Number 5

We suggest that you inspect this program to see if you can spot the errors before attempting to compile it in Delphi or Lazarus. Make the necessary changes so that each program will compile and achieve the stated purpose. Our pages on common programming errors may help you.

program PalindromeCheck;
{$APPTYPE CONSOLE}
{This program should check whether the input word is a
 palindrome.  The entry is not case sensitive.  There are
 two deliberate errors.}
uses
  SysUtils;
var
  Input : string;
function  CheckPalindrome(TestString : string): Boolean;
begin
   TestString := Uppercase(TestString);
   if ReverseString(TestString) = TestString then
     result := true
   else
     result := false;
end;
begin
  write('Please enter a word to check if it is a palindrome. ');
  readln(Input);
  if CheckPalindrome(Input) then
    writeln(Input,' is a palindrome.')
  else
    writeln(Input,' is not a palindrome.')
  readln;
end.
Programming - a skill for life!

Spot the deliberate errors