Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Error 63: Invalid file type

earnesttoearnestto Posts: 5Member
I wrote the following program and get the error message: 'Error 63: Invalid file type' in Turbo Pascal for Windows 1.5. Could anyone tell me what's wrong?

program abcd;
uses wincrt;

var f1: FILE of CHAR; i: integer;

begin

assign(f1, 'character.dat');
rewrite(f1);

for i:= 65 to 100 do
readln(f1, chr(i));

close(f1)
end.

Comments

  • zibadianzibadian Posts: 6,349Member
    : I wrote the following program and get the error message: 'Error 63: Invalid file type' in Turbo Pascal for Windows 1.5. Could anyone tell me what's wrong?
    :
    : program abcd;
    : uses wincrt;
    :
    : var f1: FILE of CHAR; i: integer;
    :
    : begin
    :
    : assign(f1, 'character.dat');
    : rewrite(f1);
    :
    : for i:= 65 to 100 do
    : readln(f1, chr(i));
    :
    : close(f1)
    : end.
    :
    You cannot use readln() and writeln() for typed files, only for text files. Use read() and write() instead. Secondly rewrite() opens the file for writing only, while your code tries to read it.
Sign In or Register to comment.