mIRC Home    About    Download    Register    News    Help

Print Thread
space to ini #169543 24/01/07 09:34 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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


Last edited by raZOR; 24/01/07 09:35 PM.

IceCapped
Re: space to ini [Re: raZOR] #169548 24/01/07 11:10 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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
Re: space to ini [Re: Riamus2] #169574 25/01/07 05:25 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
but that could corrupt ini no?
help says not to use /write for ini's


IceCapped
Re: space to ini [Re: raZOR] #169576 25/01/07 05:39 PM
Joined: Oct 2006
Posts: 342
L
learn3r Offline
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
/writeini


learn learn learn
Re: space to ini [Re: learn3r] #169577 25/01/07 06:03 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
/writeini doesnt support $crlf :P


IceCapped
Re: space to ini [Re: raZOR] #169578 25/01/07 06:20 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
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
Re: space to ini [Re: Kurdish_Assass1n] #169579 25/01/07 06:32 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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
Re: space to ini [Re: raZOR] #169583 25/01/07 07:06 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
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.

Re: space to ini [Re: DJ_Sol] #169589 25/01/07 07:30 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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
Re: space to ini [Re: Riamus2] #169591 25/01/07 07:45 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
ok this is solved smile
thanks for input all


IceCapped
Re: space to ini [Re: Riamus2] #169592 25/01/07 08:05 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
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.

Re: space to ini [Re: DJ_Sol] #169600 26/01/07 12:12 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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