procedure TForm1.OpenBtnClick(Sender: TObject);
begin
AssignFile(SaveFile,'Records.txt');
IF NOT(Fileexists('Records.txt'))Then ShowMessage('Records Not Found!')Else
begin
Reset(SaveFile);
Repeat
Readln(SaveFile,ReadStr);
Form1.Box.Items.Add(ReadStr);
until(EoF(SaveFile));
end;
end;
Normally yeah this should work and it does sometimes...
But in my program i can clear the list box. so when i click to clear it then i press the open button(its what this does) it raises an error and i dont know why. let me know if i have to post the whole code
thnx