0

I have a issue,

In my Main Tags, I functions/sub routines which follow each other once one is done. Then one of my third sub routines contains a select case, for the input 5 I want it to continue to the next sub routine, however I'm not sure on how to do this.

Sub Main()

    Task723()
    Task724()
    Task731()

End Sub

Sub Task723()
    Dim x0 = -20 ' Initial values assumed
    Dim ch As Integer
    ch = 5
    While ch <> 0
Line2:
        Console.WriteLine(vbLf & "(1)option1"
        Console.WriteLine(vbLf & "(2)option2")
        Console.WriteLine(vbLf & "(3)option3")
        Console.WriteLine(vbLf & "(4)option4")
        Console.WriteLine(vbLf & "(5)to go next")
        Console.Write(vbLf & "Enter Your Choice :")
        ch = Integer.Parse(Console.ReadLine())
        Select Case ch
            Case 1
                option1(x0)
                Console.WriteLine(vbLf & "Press Any Key To Continue...")
                Console.ReadLine()
                Console.Clear()
            Case 2
                option2(x0)
                Console.WriteLine(vbLf & "Press Any Key To Continue...")
                Console.ReadLine()
                Console.Clear()
            Case 3
                option3(x0)
                Console.WriteLine(vbLf & "Press Any Key To Continue...")
                Console.ReadLine()
                Console.Clear()
            Case 4
                option4(x0)
                Console.WriteLine(vbLf & "Press Any Key To Continue...")
                Console.ReadLine()
                Console.Clear()
            Case 5
                Console.Clear()
                GoTo Line4

            Case Else
                Console.Clear()
                Console.WriteLine(vbLf & "Invalid Input, Please Try Again")
                GoTo Line2


        End Select
Line4:
    End While
End Sub
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574

1 Answers1

0

you just want to set ch to 0 and exit subsequent While ch <> 0 check

            Case 5
                Console.Clear()
                ch = 0

BTW, you don't need neither Line2: nor Line4: along with those GoTo Line2 and GoTo Line4

DisplayName
  • 13,283
  • 2
  • 11
  • 19