#145040 - 2005-08-08 02:54 PM
ini files
|
cbf305
Fresh Scripter
Registered: 2004-11-02
Posts: 7
|
Are the ini files that KiXtart reads allowed to have comments? If they are, is there a special character that denotes a comment (i.e. ; # rem)?
Thanks John
|
|
Top
|
|
|
|
#145042 - 2005-08-08 04:56 PM
Re: ini files
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
For example... kix can only read an INI line that has a "item =" on it.
Code:
[section1] thing1 = some stuff thing2 = some more stuff and a return thing3 = even more stuff
thing4=line1 line2
kix cant read "and a return", the blank line, or the "line2"
Edited by Bryce (2005-08-08 04:59 PM)
|
|
Top
|
|
|
|
#145049 - 2005-08-15 12:56 PM
Re: ini files
|
Lee Wilmott
Starting to like KiXtart
Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
|
You are also able to comment entire sections in .INI files by placing a star before the section name...
Code:
*[section1] thing1 = some stuff thing2 = some more stuffand a return thing3 = even more stuff thing4=line1line2
Lee
|
|
Top
|
|
|
|
#145050 - 2005-08-15 01:13 PM
Re: ini files
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
You are also able to comment entire sections in .INI files by placing a star before the section name...
Code:
*[section1] thing1 = some stuff thing2 = some more stuffand a return thing3 = even more stuff thing4=line1line2
Lee
That's not actually true.
What you are doing is making the section name invalid. If there is a section earlier on in the file then the values will belong to that section.
For example: Code:
[AAA] Foo="Section 1" *[BBB] Bar="Section 2"
If you ReadProfileString("myini.ini","AAA","Bar") you will get "Section2" returned. Also enumerating section "AAA" will return the values from both sections.
There is no way to comment out a section other than commenting out every line.
You can make it invalid by prefixing it with any character including an asterisk, but whether it will work as you expect will depend upon the application.
|
|
Top
|
|
|
|
#145051 - 2005-08-15 02:49 PM
Re: ini files
|
Lee Wilmott
Starting to like KiXtart
Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
|
Richard,
OK, if I'm honest, I've never actually tested it. I just remember reading it 'many' years ago very soon after Windows 3.1 was released!
Lee
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|