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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Creating a new key in an inifile

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
peter.cook Posted - 03/24/2005 : 10:45:38 AM
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

2   L A T E S T    R E P L I E S    (Newest First)
peter.cook Posted - 03/29/2005 : 12:13:34 AM
Thanks Mike,

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


Cheers,

Pete

Mike Buess Posted - 03/24/2005 : 5:02:05 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000