mIRC Homepage
Posted By: raZOR space to ini - 24/01/07 09:34 PM
is there any way to add space in ini file between 2 sections
when writing down a section, because by default
mirc writes it all merged and $crlf doesnt work :P

[section1]
bla
bla
[section2]
bla
bla

----------
any way to make it like this?

[section1]
bla
bla

[section2]
bla
bla

Posted By: Riamus2 Re: space to ini - 24/01/07 11:10 PM
You can just use //write file.ini $crlf after each section when creating the file. That should work fine, but I haven't done a lot of testing with it.
Posted By: raZOR Re: space to ini - 25/01/07 05:25 PM
but that could corrupt ini no?
help says not to use /write for ini's
Posted By: learn3r Re: space to ini - 25/01/07 05:39 PM
/writeini
Posted By: raZOR Re: space to ini - 25/01/07 06:03 PM
/writeini doesnt support $crlf :P
Posted By: Kurdish_Assass1n Re: space to ini - 25/01/07 06:20 PM
Originally Posted By: raZOR
but that could corrupt ini no?
help says not to use /write for ini's

That's true, but, I've used /write for ini, and, nothing seemed to happen for me. I would try it if that's the only option left.
Posted By: raZOR Re: space to ini - 25/01/07 06:32 PM
well in that case i wont risk it :P

but heres another question... not to open ANOTHER INI thread :P

this alias gives me ini SECTIONS (only)

Code:
alias inisect {
  ; Syntax: /inisect inifile
  if (!$isfile($1-)) .echo -a File doesn't exist. $+($chr(40),$1-,$chr(41))
  var %i = 1
  while ($ini($1-,%i) != $null) {
    echo -a $v1
    inc %i
  }
}


but since i load this also into dialog LIST control
i am wondering is there a way on the fly during the LOAD or this loopcheck, to mirc SORT section names by alphabet, since i cant use $sorttok coz they are not separated by anything but new line

[sction1]
[section2]
...

?

Posted By: DJ_Sol Re: space to ini - 25/01/07 07:06 PM
Why do you want a space in the ini file? The ini file is a list of switches. It probably needs to follow a certain format. How you display the ini file is a different story however. I dont see why you would want a space in the ini file. It stays closed and you dont look at it. What difference does it make to you whether there is a space in it or not?

Now if you want it to display differently, simply change how you display the ini file information.
Posted By: Riamus2 Re: space to ini - 25/01/07 07:30 PM
Depending what you're doing, INI files may not always stay closed. Settings, for example, may be something you open regularly. Also, if you look at the many INI files, you'll find spaces. It makes them much easier to read when you just double click on them to open them.

Razor, using /write will NOT corrupt the INI file as long as you're using the correct format. The way it will corrupt the INI file is if you use /write the wrong way -- for example, writing a line inside a section that doesn't have an = in it (no item name or no data). As long as you know what you're doing, you can write the entire INI file using /write and it won't hurt a thing. That's a waste of time, but it could be done. The $clrf won't hurt anything.

As for sorting, I'd write the sections to a hidden window or file and then /filter it before adding it to the list window.
Posted By: raZOR Re: space to ini - 25/01/07 07:45 PM
ok this is solved smile
thanks for input all
Posted By: DJ_Sol Re: space to ini - 25/01/07 08:05 PM
I guess I just think differently. Whereas if I wanted to display the info in an ini file I would echo it to a window or dialog or something. make it pretty, vs. run file.ini.
Posted By: raZOR Re: space to ini - 26/01/07 12:12 AM
i am doing it "nice" in dialog but since i dont intend to make
deletion of sections but rather go inside inifile (for now)
i found it confusing to browse thru ini if all was merged without
any good visible order.

© mIRC Discussion Forums