954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

more loading from file

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

sez90
Newbie Poster
9 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

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

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

Micheus
Junior Poster in Training
72 posts since Jun 2006
Reputation Points: 10
Solved Threads: 4
 

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,

radu84
Junior Poster
171 posts since Dec 2006
Reputation Points: 14
Solved Threads: 16
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You