mIRC Home    About    Download    Register    News    Help

Topic Options
#169543 - 24/01/07 09:34 PM space to ini
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
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



Edited by raZOR (24/01/07 09:35 PM)
_________________________
IceCapped

Top
#169548 - 24/01/07 11:10 PM Re: space to ini [Re: raZOR]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#169574 - 25/01/07 05:25 PM Re: space to ini [Re: Riamus2]
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
but that could corrupt ini no?
help says not to use /write for ini's
_________________________
IceCapped

Top
#169576 - 25/01/07 05:39 PM Re: space to ini [Re: raZOR]
learn3r Offline
Fjord artisan

Registered: 04/10/06
Posts: 342
/writeini
_________________________
learn learn learn

Top
#169577 - 25/01/07 06:03 PM Re: space to ini [Re: learn3r]
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
/writeini doesnt support $crlf :P
_________________________
IceCapped

Top
#169578 - 25/01/07 06:20 PM Re: space to ini [Re: raZOR]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
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.
_________________________
-Kurdish_Assass1n

Top
#169579 - 25/01/07 06:32 PM Re: space to ini [Re: Kurdish_Assass1n]
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
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]
...

?

_________________________
IceCapped

Top
#169583 - 25/01/07 07:06 PM Re: space to ini [Re: raZOR]
DJ_Sol Offline
Hoopy frood

Registered: 04/01/07
Posts: 1156
Loc: Seattle
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.

Top
#169589 - 25/01/07 07:30 PM Re: space to ini [Re: DJ_Sol]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#169591 - 25/01/07 07:45 PM Re: space to ini [Re: Riamus2]
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
ok this is solved smile
thanks for input all
_________________________
IceCapped

Top
#169592 - 25/01/07 08:05 PM Re: space to ini [Re: Riamus2]
DJ_Sol Offline
Hoopy frood

Registered: 04/01/07
Posts: 1156
Loc: Seattle
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.

Top
#169600 - 26/01/07 12:12 AM Re: space to ini [Re: DJ_Sol]
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
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.

_________________________
IceCapped

Top