Originally Posted By: Mpot
Inline? That line makes no sense to me.

Inline-If.

If you've programmed in C or PHP or Perl, it has a thing called the ternary (or '?:') operator. $iif() is basically mIRC's version of that.

Simply put, it allows you to do actions inline based on a condition. The demonstration deegree showed shows it's usage beautifully.

Here's roughly how it would work if you did it in a normal /if structure:

Code:
var %output
if (1 == 1) {
  %output = %output true
}
else {
  %output = %output false
}
%output = %output ::
if (this == that) {
  %output = %output true
}
else {
  %output = %output false
}
%output = %output ::
if ($server) {
  %output = %output $v1
}
else {
  %output = %output not connected
}
echo -ag %output

As most of the regulars on this forum would tell you, this could be written in many ways, but this is just the simplest I could come up with.

The $server usage here is probably the most regularly used, for instance:

Code:
echo -a I am $iif($server,connected to $v1, not connected).

$iif is also heavily used in Popups, as it allows you to easily change the popup name:

Code:
menu channel,status,menubar {
  .-
  Away
  .Set Yourself $iif($away, as Here!, Away) : {
    if $away { away } | else { away $?="Type in away message" }
  }
}

So, it's extremely versitle.

Another example from one of my script files:
Code:
ON *:SIGNAL:maketitle {
  var %title
  var %count = $scon(0)
  ;
  ; Add NICK:NETWORK to titlebar
  ;
  while (%count) {
    %title = $+( [, $iif($scon(%count).status != connected, -, $scon(%count).me), :, $scon(%count).network , $iif( $scon(%count).away,  $+($chr(32), $chr(40), A, $chr(41)) ), ]) %title
    dec %count
  }
  ;
  ; Add playing MP3 if one exists
  ; 
  if ($inmp3) {
    %title = %title [Now Playing: $nopath($addtok(%title,: $insong.fname, 32)) $+ ]]
  }
  ;
  ; Show download/upload speed totals if using DCC
  ;
  var %up = 0, %down = 0
  var %count = $get(0)
  while (%count) {
    inc %down $get(%count).cps
    dec %count
  }
  var %count = $send(0)
  while (%count) {
    inc %up $send(%count).cps
    dec %count
  }
  if (%up || %down) {
    %title = %title $+([, $bytes(%up, k).suf, /, $bytes(%down, k).suf, ])
    .timerSpeedUpdate 1 1 .signal maketitle
  }
  ;
  ; Force the mIRC version infront of the rest of the title
  ; 
  .titlebar $version $iif($sslready, (SSL)) $iif($beta, ( $+ $beta $+ )) %title
}

This creates my titlebar string of:
Code:
6.3 (SSL) [Bekar:EFNet (A)] [Bekar:DarkerNet (A)] [Bekar:Rizon (A)] [Bekar:irchighway (A)] [-:ChatSpike] [Now Playing: ben_folds_five_-_army.mp3] [3.2KB/91.96KB]