Menu: Difference between revisions
Added AutoHotkey
Alpha bravo (talk | contribs) (Added AutoHotkey) |
|||
Line 95:
=={{header|AutoHotkey}}==
<lang AutoHotkey>Menu(list:=""){
if !list ; if called with an empty list
return ; return an empty string
return▼
for i, v in x := StrSplit(list, "`n", "`r")
string .= (string?"`n":"") i "- " v
, len := StrLen(v) > len ? StrLen(v) : len
while !x[Choice]
InputBox , Choice, Please Select From Menu, % string ,, % 200<len*7 ? 200 ? len*7 , % 120 + x.count()*20
return x[Choice]
Examples:<lang AutoHotkey>list =
(
fee fie
huff and puff
mirror mirror
tick tock
)
MsgBox % Menu(list) ; call menu with list
MsgBox % Menu() ; call menu with empty list
▲return</lang>
▲ExitApp</lang>
=={{header|AWK}}==
|