The Code runs Twice RRS feed

  • Question

  • Code runs twice:

    I have a little knowledge in VB. Decided to gain more skills.
    When I run the code shown below using both

    1. Debug > Start Without Debugging

    2. by hitting Start button

    the code runs two times. Not sure what is happening. I request help.

    Module Module1
    	Sub Main()
    		Dim Counter = 0
    		Dim outPutString
    		Dim currentChar = "-"c
    			Counter = Counter + 1
    			If Counter < 11 Then
    				outPutString = New String(currentChar, Counter)
    				'Loop While True
    			End If
    		Loop While Counter < 15
    	End Sub
    End Module

    Friday, August 7, 2020 3:33 AM

All replies

  • The problem does not seem caused by this code.

    Try an investigation: restart Visual Studio and create another simple project:

    Module Module1

       Sub Main()



       End Sub

    End Module

    Do you see the same problem?

    • Edited by Viorel_MVP Friday, August 7, 2020 5:48 AM
    Friday, August 7, 2020 5:47 AM