Solved

Ini_file

Posted on 2002-03-06
4
195 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
  • 2
4 Comments
 
LVL 27

Accepted Solution

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

meikl ;-)
0
 

Author Comment

by:janozzy
Comment Utility
ou jes

Thanks
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
glad to helped you ;-)
0
 
LVL 6

Expert Comment

by:reddarin
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now