Originally Posted By: RusselB
Try changing $network to $!network

The difference between the two is that $network gets evaluated on the first call of scon, thus it is set to the network name that the code is called from. Using $!network makes mIRC evaluate $network for each network encountered.

sigh!!! that does not work either.

I don't understand why the following code works

Code:

postmsg {
  var %i = $scon(0)
  while (%i > 0) {
    scon %i
    if ($readini(file.ini,advert,$network) !== $null) { msg $v1 $1- }
    dec %i
  }
}

file.ini
[advert]
network1=channel
network2=channel


and this code does not:

Code:
postmsg {
  var %i = $scon(0)
  while (%i > 0) {
    scon %i
    if ($readini(post.ini,advert,$network) !== $null) { msg $v1 $1- }
    dec %i
  }
}

post.ini
[advert]
network1=channel
network2=channel1,channel2