AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Lib] ini v0.15.1 - Basic ini string functions
Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Fry



Joined: 01 Nov 2007
Posts: 883

PostPosted: Sun Jul 12, 2009 10:14 pm    Post subject: Reply with quote

Roger, I'll add test soon.
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 883

PostPosted: Sun Jul 12, 2009 10:32 pm    Post subject: Reply with quote

Heres a major problem

The variable 2 is blank. I think it has to do with Misc1 & Misc2



Code:
#Include ini.ahk
f =
(
[Home]
Path=C
[Email]
Misc1=12345
Misc2=67890
)
Content := ini_getSection(f, "Email")
1 := ini_getValue(Content, "Email", "Misc1",1)
2 := ini_getValue(Content, "Email", "Misc2",1)
msgbox,%1%
msgbox,%2%
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 894
Location: Berlin, DE

PostPosted: Mon Jul 13, 2009 4:21 am    Post subject: Reply with quote

Thx for the report and taking time to test. I have fixed and updated the archive. I had allways problems with last line. The test is also added in test module. And I have given credit to you as tester.^^
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 883

PostPosted: Mon Jul 13, 2009 4:27 am    Post subject: Reply with quote

EDIT:

Still have the error, in larger ini files, it still gives error. I dont know why.
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 894
Location: Berlin, DE

PostPosted: Mon Jul 13, 2009 2:01 pm    Post subject: Reply with quote

Are you sure you downloaded and used the newer version 0.4.1 (not 0.4)? My test are success. Please send me or show the ini content and how you access that content. I would like to inspect it.
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 883

PostPosted: Mon Jul 13, 2009 4:41 pm    Post subject: Reply with quote

Let me retry.

EDIT:

I #Included wrong file, but other than that, I see no bugs
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 883

PostPosted: Mon Jul 13, 2009 5:21 pm    Post subject: Reply with quote

BTW, when do you think add section and and keys and values will be done?
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 894
Location: Berlin, DE

PostPosted: Mon Jul 13, 2009 10:03 pm    Post subject: Reply with quote

In the next days, if I have more time. And I want begin to work on add functions, only if all other functions work correct. If you or others have more test cases, let me know.
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 883

PostPosted: Mon Jul 13, 2009 10:35 pm    Post subject: Reply with quote

Ok, will do
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 883

PostPosted: Tue Jul 14, 2009 2:31 am    Post subject: Reply with quote

This bug will probably never be encountered, but It might be worth it to fix. The space look a like character, is ALT + 0160.
Other than this, these functions are rock solid

Code:
#Include ini.ahk
f =
(
[Home]
Path=C
[Email]
Misc c=12345 ; The space you see in between c and c is the character alt + 0160
Misc=67890
)
Content := ini_getSection(f, "Email")
1 := ini_getValue(Content, "Email", "Misc c",1)
2 := ini_getValue(Content, "Email", "Misc",1)
msgbox,%1%
msgbox,%2%
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 894
Location: Berlin, DE

PostPosted: Tue Jul 14, 2009 3:15 am    Post subject: Reply with quote

I have tested it and it does work. Even this is not a bug!? On my pc, this works. %1% results to "Misc c=12345 ; The space you see in between c and c is the character alt + 0160" and %2% to "67890" correctly.
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 883

PostPosted: Tue Jul 14, 2009 4:03 am    Post subject: Reply with quote

Hmmm, ok then
Back to top
View user's profile Send private message
Drugwash



Joined: 08 Sep 2008
Posts: 608
Location: Ploiesti, RO

PostPosted: Tue Jul 14, 2009 9:58 am    Post subject: Reply with quote

The ALT+0160 character is sometimes used to create a visually nice appearance of a string where the Space character is not allowed.

As an example, since years ago I have renamed my My Computer shortcut on the desktop to ALT+0160 (and assigned it a blank icon) so it would be completely invisible, since I never use it and cannot be completeley removed due to Win9x architecture, neither can the Space character be used for a name.

Same character combination may be used in web-based environment to avoid the need for %20 which takes 3 chars.

So it may not be so uncommon after all. Hopefully there is no bug in regard to this character. Unfortunately, I have not yet had time to test this script as it's a quite busy week. Crying or Very sad
Back to top
View user's profile Send private message Yahoo Messenger
Tuncay



Joined: 07 Nov 2006
Posts: 894
Location: Berlin, DE

PostPosted: Tue Jul 14, 2009 2:28 pm    Post subject: Reply with quote

Thx for the information, to Drugwash and Fry, to touch that subject. I knew that character and have allways asked me what is it good for.
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 894
Location: Berlin, DE

PostPosted: Wed Jul 15, 2009 9:02 am    Post subject: Update Reply with quote

Updated to version 0.5.

Last changes
  • Added functions: ini_insertKey() and ini_insertSection()
  • Some small corrections and changes on regexes.
  • Added some more tests. (Now 25 Test cases.)

Not sure if Regex is really the best solution for such a thing. Some more comments please.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 2 of 5

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group