[programming] Re: TIniFile problem in D3

  • From: Erwin Dokter <edokter@xxxxxxx>
  • To: programming@xxxxxxxxxxxxx
  • Date: Tue, 02 Oct 2001 17:24:28 +0200

Joshua Brannon wrote:
> 
> Here it is :
> 
> with ConfigFile.Create(ChangeFileExt(ParamStr(0),'.INI')) do

Here is the error: ConfigFile is a variable, not a type. You cannot
create the variables themselves, only a type instance. You should either
use:

  with TInifile.Create(ChangeFileExt(ParamStr(0),'.INI')) do

in which case, you do not need the ConfigFile variable. Or:

  ConfigFile := TIniFile.Create(ChangeFileExt(ParamStr(0),'.INI'))
  with ConfigFile do

These are the proper ways to use a TIniFile.

-- Erwin Dokter
   mailto:edokter@xxxxxxx
   http://members.home.nl/edokter
To unsubscribe, send a message to programming-request@xxxxxxxxxxxxx with the 
words "unsubscribe"  (without quotes) in the subject feild.  OR visit 
http://freelists.org/

Other related posts: