Solved

Ini_file

Posted on 2002-03-06
4
199 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

Suggested Solutions

Title # Comments Views Activity
Intraweb download file link ? 1 184
LAN or WAN ? 11 121
Convert a string into a TDateTime 5 80
Firemonkey Queue list 1 51
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

752 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