Module Module1
Function UnexpectedInput(y, x)
Console.ForegroundColor = ConsoleColor.Red
Console.WriteLine("Unexpected Input ! (" & y & ") ")
Console.WriteLine("Please Try Again...")
Console.ResetColor()
Console.WriteLine("")
Return x
End Function
Dim choice As String
Sub Main()
Console.WriteLine("Please Register to use this program. If you already have an account please choose Loign.")
Space(1)
Console.WriteLine("1. Login ")
Console.WriteLine("2. Register ")
Console.WriteLine("3. Exit ")
Space(1)
Console.WriteLine("##########################")
choice = Console.ReadLine()
Console.WriteLine("##########################")
If choice = "1" Then
Console.WriteLine("Login()")
Console.ReadLine()
ElseIf choice = "2" Then
Console.WriteLine("Register()")
Console.ReadLine()
ElseIf choice = "3" Then
Console.WriteLine("Exitnow()")
Console.ReadLine()
Else
UnexpectedInput(choice, "Main()")
End If
End Sub
End Module
返回X不起作用,它只是關閉應用程序。我有它的工作,現在它不起作用。我完全卡住了,我是一個新手。Return語句意外關閉的應用程序
當*** ***發揮作用時,您會發生什麼?它看起來像唯一會返回的是字符串「main()」 – Kritner
我希望它返回到Main() 我想使用它,以便向用戶顯示他輸入的是意外的並將其返回給它是在 –
然後你需要一個循環來做到這一點。循環直到滿足一些條件。你之前是如何工作的? – LarsTech