mIRC Homepage
Posted By: PoRNoMoRoZ $readini eats first color code - 03/05/07 07:37 PM
mircroot\temp\test contents:
Code:
[test]
test=10test3test8test

//echo -a $readini(temp\test,test,test)
returns 10test3test8test
Posted By: RusselB Re: $readini eats first color code - 03/05/07 11:07 PM
Try putting a space between the = and the Ctrl+K character.
Posted By: maroon Re: $readini eats first color code - 04/05/07 01:02 AM
I won't consider this a bug until you show us how you were able to use /writeini to send the eaten color codes to the .ini in the first place.
Posted By: RusselB Re: $readini eats first color code - 04/05/07 01:24 AM
At no point does the OP state that the information was written with /writeini. As ini files can be edited using a text editor, it's possible that the entry was made in that manner, rather than using /writeini.
Posted By: Doqnach Re: $readini eats first color code - 04/05/07 09:39 AM
Microsoft Windows does not support control codes in INI files. this is not a mIRC problem but a 'feature' in Windows. nothing you can do about it except using $chr() or $encode/$decode.
I used to use $decode uptill the moment it was locked by default :-[ it worked perfectly but unfortunately I can't use it anymore since users have to unlock $decode for it to work...

it goofed up for me all the time while trying to use control codes in ini files, usually by not returning the entire lines.
Posted By: Om3n Re: $readini eats first color code - 04/05/07 12:20 PM
There is no official ini file specification, therefor control codes are neither supported not unsupported in the file format itself. The ini file format is a very old configuration storage method that was surpased a long time ago, though never fully abandoned (obviously).

While it may not (im not certain) be natively supported by many API's or by microsofts API's, it is certainly not something that can not be done or that is a limitation of the format. Rather, it is a limitation of the API (or custom routine) used by the application/programming language.

There is an unofficial specification here: http://www.cloanto.com/specs/ini.html

So basically this is a limitation (or intentional behavior?) of mIRCs routines and not of the file format itself.

There are definately other programs that utilize an ini file storage method and handle control codes just fine. (a common example of this is flashfxp)
Posted By: NaquadaServ Re: $readini eats first color code - 04/05/07 02:00 PM
I had closely related problem a few years back, which is when I stopped using ini files to save things, and switched to using hash tables. More difficult to use, but if you write a nice interface, they work great. smile
© mIRC Discussion Forums