0

I totally don't get it , why i got a Additional information: Bad file name or number when Button1 was clicked in VS2008SP1 ?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim i As Integer = 0
    Do
        i += 1
        Print(i)

        If i >= 10 Then
            Print "I is above 10"
        ElseIf i >= 20 Then
            Exit Do
        End If
    Loop While (i <= 30)
End Sub
2
  • I don't really know VB, but I expect the problem might be with the Print statements - where would you expect that output to go? Do you have to open an output file first? Does the problem happen if you remove the Print statements? Does the problem happen if you remove everything except a Print statement? Commented Dec 7, 2011 at 3:35
  • This appears to be the least ideal loop construct you could have chosen. Commented Dec 7, 2011 at 3:36

2 Answers 2

2

Don't use Print(). Print() function is used to write data into a file. To print number in debug window use Debug.Print() method.

Sign up to request clarification or add additional context in comments.

Comments

0

You're misusing the print function - http://msdn.microsoft.com/en-us/library/9cksc646(v=vs.90).aspx

Are you trying to output to the console or the debug window perhaps?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.