Not sure if you made this an open answered post for the OP to figure out or not but

$replacex(You are [username],[username],$+(%,username)) is the same as: [color:#3366FF]$eval($replacex(You are [username],[username],$+(%,username)),1)[/color]

so both give You are %username

The difference in the first example is that you explicitly eval the result another time

$replacex(You are [username],[username],$+(%,username))
$eval(You are %username,1)

is the same as: $eval($replacex(You are [username],[username],$+(%,username)),[color:#333333]2)[/color]


To get back to Exlax issue:
Code:
alias test_eval {
  if ($1) {
    var %username = $1
  }
  var %moo = You are [username].
  echo -a Value of % $+ moo: %moo
  echo -a $eval($replacex(%moo, [username], % $+ username), 2)
}


This is not suppose to work. Here's why:

$eval($replacex(%moo, [username], % $+ username), 2)

the replacex results in You are %username. then when you try to re-evaluate that string it will out put You are because %username. is not the right variable and probably empty.

What starbucks_maffia pointed out quite rightly was that instead of replacing with the contents of %username replace with the string %username
so that
You are $iif([username] == $null, not logged in, logged in as [username]) $+ .
instead of turning into
You are [color:#FF0000]$iif(Mpdreamz == $null, not logged in, logged in as Mpdreamz) $+ .[/color]

becomes $iif([color:#006600]%username == $null, not logged in, logged in as %username) $+ .[/color]

which mIRC will evaluate correctly even if %username is indeed null.


$maybe