Code
menu status {
test
.test
..$submenu($subtest($1))
}
alias subtest {
   echo -sg $1
  if ($1 isin 1begin) return
  if ($1 == 2) return
   return $1 : echo -sg cmdfrompopup $1
}
There is a problem with $submenu, if you have not returned anything to create one menu item when "end" is sent, and you use the "end" iteration to return a valid menu item, making that returned item the only menu item, it won't work, it won't get displayed.
The above code will execute /return for both "begin" but especially "1", making $submenu's next call the "end", in which case "return $1 : echo -sg cmdfrompopup $1" is returned, but is never displayed.
Change "1begin" to "begin" so that the iteration with "1" result in a valid menu item from the "/return $1 : echo -sg ..", making then the "2" iteration an empty /return, which then makes the next iteration "end". But this time, the "end" menu item shows up.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel