$iif() (or any other method) won't help with cases where the total number of menu items is not known. A popular example is this: create a (sub)menu with all log files currently in $logdir, so that the user can click on an item and view the file in an editor:
Code:
menu status {
  Logs
  .$submenu($logsmenu($1))
}
alias logsmenu {
  if $1 == begin {
    close -@ @@ | window -hsl @@
    halt $findfile($logdir,*,0,1,@@)
  }
  if $line(@@,$1) { return $nopath($v1) : run notepad $+(",$v1,") }
  window -c @@
}

There is simply no way of doing this with $iif().


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com