Im very new to using files and im really struggling to fix this any help would be great.
It seems that the error is coming from my read array function but not entirely
sure i am also not to sure what the 104 error really means
thanks in advance
lineArray = array [0..19] of String;
procedure PrintArray(lines: lineArray);
for i:=0 to High(lines) do
WriteLn('Text is: ', lines[i], ' Line number is: ', i);
function ReadArray(var myFile: TextFile):lineArray;
count : Integer;
lines : lineArray;
for i := 0 to count do
result := lines;
You don't know what that error means. Neither do I off the top of my head. So, let's look it up in the documentation and find out. Websearch takes us here: https://www.freepascal.org/docs-html/user/userap4.html
File not open for input
Reported by Read, BlockRead, Eof, Eoln, SeekEof or SeekEoln if the file is not opened with Reset.
You have your calls to open the file the wrong way round. Call
Reset to open for reading,
Rewrite to open for writing.
count + 1iterations. I'd expect to see you looping from 0 to
count - 1.