mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 26
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Aug 2004
Posts: 26
When using $readini, you can retrieve text with as many spaces as you wish, as it's separated by commas. However, as the /writeini command is not separated as such, you can't write an INI section with more than one word by default. Is there a way around this?
Code:
writeini scripts/Guide.ini "Two Words"  Reason Need to retrieve info!
msg $active $readini(scripts/Guide.ini, Two Words, Reason)

Need to retrieve info!

Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
You could replace the space with $chr(160) or an underscore ( $chr(95) ).

With the underscore, you will have to replace it back to a space when you retrieve the data.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
You can also do <bold>_space_<bold> as this will work for any font since chr160 isn't a "blank space" in every font.

<bold> = ctrl + b
_space_ = a space, obviously.

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I don't know why it doesn't work for you
test
Code:
/writeini test.ini new line1 testing to see if multiple lines will write
then:
//echo -s $readini(test.ini,new,line1)

this works correctly for me.

Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
You're example will write this..
[new]
line1=testing to see if multiple lines will write

He wants to be able to write something like this..
[new section]
line 1=testing to see if multiple lines will write

Last edited by mIRCManiac; 22/02/06 07:53 PM.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I don't think that sections in an ini file are meant to have spaces in them. They should be replaced with another character, such as a _ (underscore).

However, you can write to sections with spaces by using quotes around the section name.

/writeini file.ini "new section" item data here

Apparently you can't do the same for the items.

-genius_at_work

Joined: Aug 2004
Posts: 26
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Aug 2004
Posts: 26
I've been trying that, and it doesn't seem to work. It's getting the data from a $did(4).seltext.
Code:
$iif($did(14).state == 1, writeini scripts/ACGuide.ini $("$did(201).seltext") Gotten Yes)
Wherein 201 is a list of items. 14 is a checkbox, so when you click on the item in 201 and check the box, it is written in the INI file that you have collected the item. The problem occurs when the title of the item is two words - I've been using two words because for reading purposes, it makes more sense for it to be displayed as "Red chair," and not "Redchair."

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
//writeini file.ini Some Section $replace(Some Item,$chr(32),$chr(95)) Some Data

[Some Section]
Some_Item=Some Data

There's also another solution that gets talked about alot on here. But is always argued against because it only works for certain fonts.

//writeini file.ini Some Section $replace(Some Item,$chr(32),$chr(160)) Some Data

[Some Section]
Some Item=Some Data

I'm not going to go through all the fonts to see which one works but mIRC's default Fixedsys will work. smile

-Andy

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Try this:

$iif($did(14).state == 1, writeini scripts/ACGuide.ini $+(",$did(201).seltext,") Gotten Yes)

The $() identifier is used to evaluate. It is a shortcut to $eval().

The $+() identifier is used to concatenate (join) the items that are separated by commas.

-genius_at_work

Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
Quote:
$+(",$did(201).seltext,")


$qt($did(201).seltext) wink

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Sure sure.. use those new fangled identifiers :P

-genius_at_work

Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
New identifiers are the candy in the store and I'm the kid. grin

~ Edit ~
btw, anyone checked out IE 7 ? tabbed browsing and everything.

Last edited by mIRCManiac; 22/02/06 10:03 PM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I am deeply in love with "check", the list box's new property! Without the use of any custom DLL's it makes me wonder on what other dialog features we will see in the future. smile

-Andy

Joined: Aug 2004
Posts: 26
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Aug 2004
Posts: 26
Seems that worked! I'd tried $+() before with no quotation marks or commas, but this has solved my problems! Thanks a ton, all of you.

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
ah, completely misread his post.
/action returns to bed.


Link Copied to Clipboard