Visual Basic question

my mentor

My mentor gave me this, and I'm quite sure that his code isn't good...



Dim getal1, getal2, getal3 As Integer
Dim tweede As Integer

Private Sub Command1_Click()

getal1 = 0
getal2 = 1
fibonacci.AddItem (("1. " & getal1))
fibonacci.AddItem (("2. " & getal2))
For teller = 3 To 20 Step 3
getal3 = getal2 + getal1
fibonacci.AddItem ((teller & ". " & getal3))
getal1 = getal2 + getal3
fibonacci.AddItem ((teller + 1 & ". " & getal1))
getal2 = getal1 + getal3
fibonacci.AddItem ((teller + 2 & ". " & getal2))
Next

End Sub
 
Difference would be:

His would show

1.0
.
.
20.6765 (if my calcutaions are correct).

His code make the starting point a constant.

Don't know wether the 'teller' should also be declared, think it should.


Just a few things I notice
 

Similar Topics

Replies
8
Views
1,996
What's the difference between a 'checkbox' and an 'option button' ? I know that only one optionbutton can be true in a form or you have to use...
Replies
3
Views
3,451
Dear experts, I am want to program RS view32 with help of Microsoft visual basic (visual basic editor). But how to start I don't know,please...
Replies
10
Views
2,385
help How do I create Bidirectional Activex Connection Arrows? As per attached photo. How to Create RightoLeft Property in Visual Basic - Activex?
Replies
3
Views
1,667
I'm just trying to load from a text file into a string. I don't get why this doesn't work. Function LoadFile(FileName As String) As String()...
Replies
0
Views
1,553
Back
Top Bottom