AutoHotkey Community

It is currently May 26th, 2012, 3:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: April 28th, 2008, 5:33 am 
Offline

Joined: March 17th, 2008, 11:41 am
Posts: 15
I am struggling to find out how to overwrite on sertain rows in a file...

FileReadLine works perfect for me.

I Search for a command linke FileWriteLine...

Probably just me putting on the wrong search strings, but if any could help me i would appreciate it.

To make it clear, it is an .ini file where Defaults is stored, i can read it with FileReadLine good np there

But then i want the option for the user to click Save theese settings as Default, and then i want to save thoose variables to that file.

So what i search for is a command like FileOverwriteLine...

Think this is just me new at ahk and a noob question, but please answer anyway.


Last edited by TalkieToaster on April 29th, 2008, 10:04 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2008, 5:36 am 
Offline

Joined: April 21st, 2008, 9:02 pm
Posts: 86
Location: somewhere
search iniread and iniwrite


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2008, 4:40 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
is the INI file in the "standard" format?

can you post a small piece of it as an example?

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject: My code
PostPosted: April 28th, 2008, 5:49 pm 
Offline

Joined: April 28th, 2008, 2:55 pm
Posts: 48
Here's what I use to read/write to the ini file

Code:
STATE_READ(module, name, default="") {

   IniFile = %A_ScriptDir%\application.ini
   IniRead, var, %IniFile%, %module%, %name%

   if (var = "ERROR")
      var := default
   
   Return var
}

STATE_WRITE(module, name, var) {

   IniFile = %A_ScriptDir%\application.ini
   IniWrite, %var%, %IniFile%, %module%, %name%
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2008, 8:36 pm 
Offline

Joined: March 17th, 2008, 11:41 am
Posts: 15
Thanks all for your fast responce, Iniread and Iniwrite was just the commands i was searching for.

/TT


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2008, 9:32 pm 
Offline

Joined: April 21st, 2008, 9:02 pm
Posts: 86
Location: somewhere
I use this:
Code:
IniRead(pFile,pSection,pKey,pDefault=""){
   IniRead, Ret, %pFile%, %pSection%, %pKey%, %pDefault%
   Return Ret
   }


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2008, 10:54 pm 
Offline

Joined: June 27th, 2006, 2:38 pm
Posts: 385
Location: Canada
When it's solved, mark the title of the thread like this: (For easy readability)

[Solved] Thread Topic Here (Epic Win)

rather than

Thread Topic Here .. Solved (Epic Fail, like Titan's captcha. :D)

Thx for listening. 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2008, 10:06 am 
Offline

Joined: March 17th, 2008, 11:41 am
Posts: 15
KK changed it, think you are right there mate, easier to see it if Solved is in the beginning of the topic.

Thanks for your comment!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Google Feedfetcher and 26 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group