The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Creating a new key in an inifile
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 03/24/2005 :  10:45:38 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5SR5
Operating System: 2000

Hi,

I'd like to add a new key and value to an (nlsf.) ini file with Origin C. How can I do this? I presume I can use writeini to add /alter a value for an existing key.

Thanks,

Cheers,

pete

Mike Buess

USA
3037 Posts

Posted - 03/24/2005 :  5:02:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pete,

Origin 7.5's INIFile::WriteInt and INIFile::WriteString will create the keys and sections named as arguments if they don't already exist. (It will even create the INI file if necessary.) This will add a key called MyInt (and sets its value to 50) to the NLSF Control section of NLSF.ini on the user path.

INIFile ini("NLSF.ini");
ini.WriteInt("NLSF Control", "MyInt", 50);

Mike Buess
Origin WebRing Member
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 03/29/2005 :  12:13:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike,

I'm going to use this to auto-update ini files for all our client users.


Cheers,

Pete

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000