I don't know what it could be without more information. What's the code that follows?
Ok. Here's the whole shebang:
procedure TForm1.Menu_File_Open_ItemClick(Sender: TObject);
var
ProjectFile: TIniFile;
ChecklistFile: String;
Ans: Integer;
begin
with OpenDialog1 do begin
InitialDir := LastDir;
DefaultExt := 'rev';
Filter := '*.rev';
end;
ProjectFileName := '';
if OpenDialog1.Execute then ProjectFileName := OpenDialog1.Filename;
Showmessage(ProjectFileName);
if ProjectFileName = '' then exit;
ChecklistFile :='';
LastDir := ExtractFileDir(ProjectFileName);
ProjectFile := TIniFile.Create(ProjectFileName);
try
ProjectFile.ReadString('Compound','ID', CompoundID);
ProjectFile.ReadString('Compound','Name', CompoundName);
ProjectFile.ReadString('Checklist','File', ChecklistFile);
ChecklistSynEdit.Lines.LoadfromFile(ChecklistFile);
ChecklistSynEdit.Visible := True;
ProjectIsOpen := True;
ProjectHasChanged := False;
UpdateMenus();
finally
ProjectFile.Free;
end;
end;
The problem arises that with the hex-ified filename, TIniFile.Create does not open the specified file, which already exists, then ProjectFile.ReadString('Checklist','File', ChecklistFile) reads in a blank ChecklistFile (which is a file name), and then ChecklistSynEdit.Lines.LoadfromFile(ChecklistFile) bombs with '' for ChecklistFile.