Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Declare TIniFile 1

Status
Not open for further replies.

annmartinson

Programmer
Aug 7, 2005
2
0
0
US
I'm a gross beginner, decent in PHP, new to Delphi. I've copied some code from a tutorial that is in part >

Code:
procedure TForm1.FormCreate(Sender: TObject);
var
  Ini: TIniFile;

begin
  Ini := TIniFile.Create( ChangeFileExt( Application.ExeName, '.ini' ) );
  try
    ImportDir:= Ini.ReadString('General','ImportDir','\\Server\MDServe\Server\Data\Emc_new');
    Top     := Ini.ReadInteger( 'Form', 'Top', 100 );
    Left    := Ini.ReadInteger( 'Form', 'Left', 100 );
    Caption := Ini.ReadString( 'Form', 'Caption', 'New Form' );
    if Ini.ReadBool( 'Form', 'InitMax', false ) then
      WindowState = wsMaximized
    else

      WindowState = wsNormal;
  finally
    TIniFile.Free;
  end;
end;


when I attempt to compile I am getting "Undeclared identifier: 'IniFile'

I know this is basic, basic, but I have no idea what to do next. I am assuming something goes above in the 'uses' or 'type' section, but I have no idea what.

OS is Win2000, Delphi 7.0

thanks much!
 
Hi,

just add inifiles to the uses list.
if you are uncertain what unit to add, put the cursor under Tinifile and tap F1, the help file usually indicates which component resides in what unit...

cheers,
Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top