AutoHotkey Community

It is currently May 27th, 2012, 10:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: April 2nd, 2011, 1:42 pm 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
Morpheus wrote:
nimda wrote:
Here's a tougher one: GlobalsToINI() :?:


Like this?

http://www.autohotkey.com/forum/topic21346.html

I wish I had seen that sooner. :(


Indeed. I was so happy to find that. Making it lib-compatible would be a great addition though, I renamed the functions ini_initialize etc., but there are alot of "ini.ahk" libraries.

_________________
~sumon Appifyer AHK Nova halted Recommended: AHK_L (Why?)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 2nd, 2011, 2:30 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
Here is a later work of me: Basic Ini String Functions
It does not create global variables. Instead it works with the original source, means ini data as it is. And related to this, it have the globalsFromIni() function too: ini_exportToGlobals()

sumon wrote:
I renamed the functions ini_initialize etc., but there are alot of "ini.ahk" libraries.

I was working on a v2 with "bini"-prefix to avoid such problems. You could use any prefix and put in lib folder for auto inclusion. Or you can leave "ini"-prefix and include it in your script via #include. Then this have higher priority than the "ini.ahk" library in Lib-folder. (hope its correct information)

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 2nd, 2011, 2:38 pm 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
Tuncay wrote:
Here is a later work of me: Basic Ini String Functions
It does not create global variables. Instead it works with the original source, means ini data as it is. And related to this, it have the globalsFromIni() function too: ini_exportToGlobals()

sumon wrote:
I renamed the functions ini_initialize etc., but there are alot of "ini.ahk" libraries.

I was working on a v2 with "bini"-prefix to avoid such problems. You could use any prefix and put in lib folder for auto inclusion. Or you can leave "ini"-prefix and include it in your script via #include. Then this have higher priority than the "ini.ahk" library in Lib-folder. (hope its correct information)


Thanks :) And that's nice, keep working ^^

_________________
~sumon Appifyer AHK Nova halted Recommended: AHK_L (Why?)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 26th, 2012, 5:24 pm 
i have an INI file with a lot of texts like...
Code:
128= Taiwan
136= Korea
144= Hong Kong
 . . .

and want to display the number code and the countries... so it's pretty useful if can do it...
Great then!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2012, 8:21 pm 
Anonymous wrote:
and want to display the number code and the countries..


If you like, look at one of my other works. There are more solutions to that, but I show you my old way to work with ini files: http://www.autohotkey.com/forum/viewtopic.php?t=46226

This examples awaits an ini file in same folder with this content:
Code:
[section]
128= Taiwan
136= Korea
144= Hong Kong


Code:
#NoEnv
#Warn
SendMode, Input
SetWorkingDir, %A_ScriptDir%

ini_load(ini, "myini.ini")

; Get a list of all key names under section "section".
keys := ini_getAllKeyNames(ini, "section")

; Display all key names, which are saved as a comma separated list.
Loop, Parse, keys, `,
{
    MsgBox %A_LoopField%
}

; Get and display each associated value for all keys.
Loop, Parse, keys, `,
{
    MsgBox % ini_getValue(ini, "section", A_LoopField)
}


You need the Basic Ini String Library-Library, if you want to use that example.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 13 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