hey umm ok this is wat i've got now for loading words from a file but it still doesn't work can u help?


type
Words = record
easywords: string [20];
mediumwords: string [20];
difficultwords: string [20];
end;
var WordFile: file of words;

procedure TLevelForm.EasyBtnClick(Sender: TObject);
var Easywords: string;
Wordfile: string;
begin
AssignFile (wordfile, 'EasyWords.txt');
reset (wordfile);
while not eof (wordfile) do
begin
Read (Easywords, 'wordfile');
Write (wordfile);
end;
CloseFile (Easy);

thanks heaps

Member Avatar for Micheus

try replacing:
Read (Easywords, 'wordfile');
Write (wordfile);

by:
Readln (wordfile, Easywords);
Writeln (
Easywords);

i'm not understanding something, why you're using records? and i'm not sure if you can use records in this way. usualy a record is used in this way

record_variable[index].record_type

best regards,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.