Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2001, 08:31 AM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default How to load/save from/to INI files without components?

Can anybody help me to do this?

Thx...gLes
Reply With Quote
  #2  
Old 01-05-2001, 09:41 AM
doron_bp doron_bp is offline
Junior Member
 
Join Date: Jan 2001
Posts: 2
Default RE: How to load/save from/to INI files without components?

You don't need any components, it's build-in Delphi!
all you need is to add in the 'USES' line the unit 'IniFiles'
Here is an Example of using the INI files:

Uses IniFiles;

Var
IniF:TIniFile;

Procedure Demo;
Begin
IniF:=TIniFile.Create('Filename.ini');
IniF.WriteString('Section','Ident','Value');
IniF.WriteInteger('Section','IdentInt',100);
IniF.WriteBool('Section','IdentBool',False);
// in the ini file you'll see:
// [Section]
// Ident=Value
// IdentInt=100
// IdentBool=False
// and now let's read the ini file
IniF.ReadString('Section','Ident','Default');
IniF.ReadInteger('Section','IdentInt',0);
IniF.ReadBool('Section','IdentBool',True);
// The third parameter is the default in case that
// there is no value!
IniF.Destroy;
End;

This demo seems to work just fine! and it's all include Delphi 4,5 (or maybe 3)!

The Default location of the file is in your windows directory!!! (this is very good) unless you define it else!
the only limitations is that the file must be less than 64K!!! don't ask me why...
Reply With Quote
  #3  
Old 01-05-2001, 09:55 AM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: RE: How to load/save from/to INI files without components?

Thx...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.