| View previous topic :: View next topic |
| Author |
Message |
TalkieToaster
Joined: 17 Mar 2008 Posts: 15
|
Posted: Mon Apr 28, 2008 4:33 am Post subject: [Solved] Another Noob question from me... Iniwrite... |
|
|
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 Tue Apr 29, 2008 9:04 am; edited 2 times in total |
|
| Back to top |
|
 |
SomeGuy
Joined: 21 Apr 2008 Posts: 96 Location: somewhere
|
Posted: Mon Apr 28, 2008 4:36 am Post subject: |
|
|
| search iniread and iniwrite |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Mon Apr 28, 2008 3:40 pm Post subject: |
|
|
is the INI file in the "standard" format?
can you post a small piece of it as an example? _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
joebodo
Joined: 28 Apr 2008 Posts: 45
|
Posted: Mon Apr 28, 2008 4:49 pm Post subject: My code |
|
|
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%
}
|
|
|
| Back to top |
|
 |
TalkieToaster
Joined: 17 Mar 2008 Posts: 15
|
Posted: Mon Apr 28, 2008 7:36 pm Post subject: |
|
|
Thanks all for your fast responce, Iniread and Iniwrite was just the commands i was searching for.
/TT |
|
| Back to top |
|
 |
SomeGuy
Joined: 21 Apr 2008 Posts: 96 Location: somewhere
|
Posted: Mon Apr 28, 2008 8:32 pm Post subject: |
|
|
I use this:
| Code: | IniRead(pFile,pSection,pKey,pDefault=""){
IniRead, Ret, %pFile%, %pSection%, %pKey%, %pDefault%
Return Ret
}
|
|
|
| Back to top |
|
 |
Conquer
Joined: 27 Jun 2006 Posts: 385 Location: Canada
|
Posted: Mon Apr 28, 2008 9:54 pm Post subject: |
|
|
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. )
Thx for listening.  _________________
 |
|
| Back to top |
|
 |
TalkieToaster
Joined: 17 Mar 2008 Posts: 15
|
Posted: Tue Apr 29, 2008 9:06 am Post subject: |
|
|
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! |
|
| Back to top |
|
 |
|