Advertisement
klasscho

Untitled

Nov 28th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. function IsTheMatrixCorrect(var MyFile: TextFile): Boolean;
  2. var
  3. Number: Integer;
  4. TrueMatrix, IsValidInput: Boolean;
  5. begin
  6. TrueMatrix := True;
  7. while (not Eof(MyFile)) do
  8. begin
  9. try
  10. read(MyFile, Number)
  11. except
  12. TrueMatrix := False
  13. end;
  14. end;
  15. if Eof(MyFile) then
  16. IsValidInput := True
  17. else
  18. Writeln('File is empty.');
  19. Reset(MyFile);
  20. IsTheMatrixCorrect := TrueMatrix;
  21. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement