Menu: Difference between revisions

→‎{{header|VBScript}}: make prompt input instead of hard-coded...
(→‎{{header|VBScript}}: make prompt input instead of hard-coded...)
Line 3,095:
=={{header|VBScript}}==
<lang vb>'The Function
Function Menu(ArrList, Prompt)
Select Case False 'Non-standard usage hahaha
Case IsArray(ArrList)
Line 3,109:
WScript.StdOut.WriteLine((i + 1) & ". " & ArrList(i))
Next
WScript.StdOut.Write("Which is from the three pigs: "Prompt)
Choice = WScript.StdIn.ReadLine
'Check if input is valid
Line 3,128:
'The Main Thing
Sample = Array("fee fie", "huff and puff", "mirror mirror", "tick tock")
InputText = "Which is from the three pigs: "
WScript.StdOut.WriteLine("Output: " & Menu(Sample, InputText))</lang>
{{Out}}
<pre>C:\>cscript /nologo menu.vbs
535

edits