How do i read stuff from a config (.cfg) file?

Please discuss general Delphi programming topics here.

How do i read stuff from a config (.cfg) file?

Postby zero » September 16th, 2003, 4:09 pm

I would really need to read some stuff out of another application's config (.cfg) file in my application. How do I do that?
zero
Active Member
Active Member
 
Posts: 5
Joined: September 16th, 2003, 3:33 pm

Postby Kambiz » September 16th, 2003, 5:15 pm

Do you know the format and fields of the config file?
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Johnny_Bit » September 16th, 2003, 7:41 pm

I'll give you advice: "File extension isn't so important, that data inside file" besides basing on file extension you won't ever know if file is this file, that you're thinking
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby zero » September 23rd, 2003, 12:26 pm

The line I would need looks like this:
"value" "25"
I would also need to save this line into the cfg file after modifying, because other applications also use this file.
zero
Active Member
Active Member
 
Posts: 5
Joined: September 16th, 2003, 3:33 pm

Postby Kambiz » September 23rd, 2003, 4:47 pm

You can use a TStringList to read the file, pharse and change the content, and save it back.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 6 guests

cron