I am trying to make a application that will generate a Fibonacci Sequence.I am new to Visual Basic so I came to a stupid problem.Even I have used the WriteLine() again I can't make it work.I checked my other apps too , that used the same syntax but this doesn't work.
So a little help would be appreciated.
The problem is that even everything works just fine (the progress bar etc) the file generated will be blank.
There are 2 textboxes (filebox and timesbox) , one progress bar (pb1) and one button (startbut)
thank youCode:Public Class Form1 Private Sub startbut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startbut.Click Dim file As String = filebox.Text Dim StreamWriter As New System.IO.StreamWriter(file) Dim i As Integer = 3 Dim times As Integer = timesbox.Text Dim a As Integer = 1 Dim b As Integer = 1 Dim c As Integer = 2 StreamWriter.WriteLine(1) StreamWriter.WriteLine(1) StreamWriter.WriteLine(2) Do Until i = times a = c + b StreamWriter.WriteLine(a) i = i + 1 pb1.Value = i / times * 100 If i = times Then Exit Do b = a + c StreamWriter.WriteLine(b) i = i + 1 pb1.Value = i / times * 100 If i = times Then Exit Do c = a + b StreamWriter.WriteLine(c) i = i + 1 pb1.Value = i / times * 100 If i = times Then Exit Do Loop End Sub End Class
EDIT:I have already created a batch file so all the math etc are correct.
EDIT2:Unfortunately I am leaving today for about 5 days so I won't be able to answer you.




Reply With Quote