| |
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
|
I had the need to redo my gui menu system to work on a cli, so here ya go 'cli menu Dim objgui 'create an obj from the class set objmenu = New cli_menu 'start menu objmenu.getInput Class cli_menu private Input, blah, quit, strText Private sub pickInput 'test for user input Select Case Input Case "1" WScript.StdOut.Writeline ("You entered: " & Input) getInput Case "2" WScript.StdOut.Writeline ("You entered: " & Input) getInput Case "3" WScript.StdOut.Writeline ("You entered: " & Input) getInput Case "4" WScript.StdOut.Writeline ("You entered: " & Input) getInput Case "5" WScript.StdOut.Writeline ("You entered: " & Input) getInput Case "6" 'make sure they want to quit WScript.StdOut.Writeline ("Are you sure? (y/n)") quit = WScript.StdIn.ReadLine If quit = "y" Then WScript.StdOut.Writeline ("Bye!!") WScript.Quit Else getInput End If Case Else WScript.StdOut.Writeline ("That is an incorrect entry, try again") getInput End Select End sub 'pickInput Public sub getInput wScript.StdOut.writeline "Enter selection below." 'quick menu for testing, replace with your own menu For i = 1 To 5 WScript.StdOut.writeline i & " = blah" & i Next wScript.StdOut.writeline "and 6 to quit." input = WScript.StdIn.ReadLine pickInput End sub 'getInput End Class 'cli_menu
< Message edited by kirrilian -- 12/28/2005 8:29:09 AM >
_____________________________
Have you searched here ? VBScript Fundamentals My Site
|
|