Solved

Ini_file

Posted on 2002-03-06
4
201 Views
Last Modified: 2010-04-05
Hi all
I need to write a small progman.
program read and write to ini-file.
And i want to keep inifile in program homedirectory

this code works but Is there any other way to locate file?

pelaajatiedot:=Tinifile.Create('c:\homedir\PackAliases.ini');

Thanks
Janozzy
0
Comment
Question by:janozzy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 6844779
pelaajatiedot:=Tinifile.Create(ExtractFilePath(Application.exeName)+'TheIniFileName.Ini');

meikl ;-)
0
 

Author Comment

by:janozzy
ID: 6844799
ou jes

Thanks
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6844846
glad to helped you ;-)
0
 
LVL 6

Expert Comment

by:reddarin
ID: 6852436
I find it very handy to use ChangeFileExt() like so:

var
  IFile: TIniFile;
begin
  try
  IFile := TIniFile.Create(ChangeFileExt(paramstr(0),'.ini'));
  //do stuff
  finally
  FreeAndNil(IFile);
  end;
end;

reddarin =)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month10 days, 9 hours left to enroll

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question