Quote Originally Posted by User137 View Post
Well, you used this sort of structure a few times:
Code:
repeat
  ...
  readln(key);
  key := upcase(key);
until (key = 'Y') or (key = 'N');
if (key = 'N') then begin
  ...
end;
if (key = 'Y') then begin
  ...
end;
Whereas it should be written:
Code:
if (key = 'N') then begin
  ...
end
else if (key = 'Y') then begin
  ...
end;
Because then it will only check the first IF and ignore the other condition entirely (if 'N' was entered). In the first code it checks both codes which is extra work for CPU, and a possible cause for logic errors in program.
Thanks for the tip! I didnt knew about this . Well nevermind... i fixed the whole thing by myself again D: Thank you everyone!