Error 63: Invalid file type - Programmers Heaven

Howdy, Stranger!

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

Categories

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.