mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2005
Posts: 11
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Nov 2005
Posts: 11
right im using write ini
basicly
i tried in brackets and $+

writeini list.ini access $+ $chr(32) $+ list $$2 $$3
and
writeini list.ini (access list) $$2 $$3

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I think you have to enclose it in quotes " "

example: writeini list.ini "access list" $$2 $$3

Joined: Nov 2005
Posts: 42
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
I had this problem. I got around it by renaming the space character tokenised list to one tokenised with underscores:
Code:
var %j = 1
set %desc $null
while ( %j <= $gettok($did($dname,2),0,32) ) {
  set %desc $addtok( %desc,$gettok($did($dname,2), %j, 32), 95 )
  inc %j
}

where the name of the ini file section is read from that dialog call and stored tokenised with underscores in %desc for use later in writing to the inifile.
To read it back from the ini file I used
Code:
var %j = 1
set %desc $null
while ( %j <= $gettok( $ini(%inifile, %i), 0, 95) ) {
  set %desc $addtok( %desc,$gettok($ini(%inifile, %i), %j, 95), 32 )
  inc %j
}

Here %desc, is the section title read back from the ini and retokenised using spaces. The path to the ini is %inifile

Edit: That post appeared whilst I was writing this, please tell me if the quotes work and I wasted a lot of time frown

Last edited by Aenei; 18/12/05 09:12 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Rather than using the codes that you wrote up, you could've used
Code:
 set %desc $replace($did($dname,2),$chr(32),$chr(95)) 

and likewise to reverse it...I couldn't make a modification of your second code since you use %i in the code, but %i isn't set or evaluated in the code.

Joined: Nov 2005
Posts: 42
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
Thats such a simpler way of doing it. Why didn't I think of that. %i is set somewhere else, but yes the second code could be altered in a similar manner without much bother.

Not to worry I'm probably going to recode the whole thing to use hash tables shortly anyway.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
when you recode for hash tables, rather than losing the information in your ini files, or having to redo it all again, remember the -i switch in /hload & /hsave

Joined: Nov 2005
Posts: 42
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
Quote:
when you recode for hash tables, rather than losing the information in your ini files, or having to redo it all again, remember the -i switch in /hload & /hsave

Yup, well, as mentioned in my thread about ini's and hash tables, they're not quite importing right.


Link Copied to Clipboard