R
Ron
I am trying to populate a listbox with dates of easter from 1901 to
2099. My code is not doing it. Here is what I have. What am I doing
wrong?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim a As Integer = 0
Dim b As Integer = 0
Dim c As Integer = 0
Dim d As Integer = 0
Dim g As Integer = 0
Dim easter As Integer = 0
Dim easterinapril As Integer = 0
Dim i As Integer = 1900
a = (i) Mod 19
b = i Mod 4
c = i Mod 7
d = (19 * a + 24) Mod 30
g = (2 * b + 4 * c + 6 * d + 5) Mod 7
easter = (22 + d + g)
easterinapril = (easter - 31)
Do
While i < 2099
If easter > 31 Then
lstResult.Items.Add("April " & easterinapril & ", "
& i)
Else : lstResult.Items.Add("March " & easter & ", " &
i)
End If
End While
i = i + 1
Loop
End Sub
2099. My code is not doing it. Here is what I have. What am I doing
wrong?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim a As Integer = 0
Dim b As Integer = 0
Dim c As Integer = 0
Dim d As Integer = 0
Dim g As Integer = 0
Dim easter As Integer = 0
Dim easterinapril As Integer = 0
Dim i As Integer = 1900
a = (i) Mod 19
b = i Mod 4
c = i Mod 7
d = (19 * a + 24) Mod 30
g = (2 * b + 4 * c + 6 * d + 5) Mod 7
easter = (22 + d + g)
easterinapril = (easter - 31)
Do
While i < 2099
If easter > 31 Then
lstResult.Items.Add("April " & easterinapril & ", "
& i)
Else : lstResult.Items.Add("March " & easter & ", " &
i)
End If
End While
i = i + 1
Loop
End Sub