procedure ListMembers;
var
Member, lMembers: string;
lengthOfMember: Longint;
begin
Writeln;
Writeln;
Reset(FileA); //Only need read-only
Reset(FileB); //Only need read-only
while not Eof(FileA) do
begin
Readln(FileA, lMembers);
Write(lMembers);
end;
Writeln(sLineBreak + sLineBreak);
Write('Type the name of the member for more information: ');
Readln(Member);
lengthOfMember := Length(Member) + 2;
Seek(FileB, lengthOfMember);
end;
I get a problem here when trying to compile. The Seek(); on the last line returns the error incompatible type. As far as I've read online, Seek takes in var: File and var: longint so I don't see why it's considered a bad type as I'm feeding it a file, and a longint.
FileB was Assigned to a text file in the main section of the code. This part is just a procedure.
Appreciate any help. More of the code below.
program WoWProject;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
TMember = record
Name : string;
Level : integer;
CharClass : string;
Role : string;
Spec : string;
DKP : integer;
end;
var
FileA, FileB : Textfile;
//THIS PART IS THE PROCEDURE ABOVE
//ANOTHER PROCEDURE HERE UNRELATED TO THIS
//ANOTHER HERE WHICH IS THE WELCOME PROCEDURE
//MAIN
begin
Assign(FileA, 'CharacterNames.txt');
Assign(FileB, 'CharacterInfo.txt');
repeat
Append(FileA);
Append(FileB);
Welcome;
until 1=2
end.
FileB
isn't in the scope and because of that compiler assumes it to be a integer? – ainFileB
. – Steve Mayne