the following code
  var aIniFile: TIniFile;
  procedure ASpecialEvent (aIniFile: TIniFile );
  begin
  ....
  if (aIniFile <> nil) then
  begin
    if fileexists(aIniFile.filename) then   //  Error is here ....
    begin
       ...... 
    end;
  end; 
  end;
  //   mainformcode  
  //   i Need to call this procedure even the Tini file is not yet created 
  ASpecialEvent(ainifile);
fails with an Access Violation. The infile is not Nil but I can not access the the filename property. How to check more efficient if the file is valid or not?
 
     
    