Menu: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) |
(add FreeBASIC) |
||
Line 1,176: | Line 1,176: | ||
</lang> |
</lang> |
||
=={{header|FreeBASIC}}== |
|||
<lang freebasic>dim as string menu(1 to 4)={ "fee fie", "huff and puff", "mirror mirror", "tick tock" } |
|||
function menu_select( m() as string ) as string |
|||
dim as integer i, vc = 0 |
|||
dim as string c |
|||
while vc<1 or vc > ubound(m) |
|||
cls |
|||
for i = 1 to ubound(m) |
|||
print i;" ";m(i) |
|||
next i |
|||
print |
|||
input "Choice? ", c |
|||
vc = val(c) |
|||
wend |
|||
return m(vc) |
|||
end function |
|||
print menu_select( menu() )</lang> |
|||
=={{header|Gambas}}== |
=={{header|Gambas}}== |