Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
Public Function IsEven(I As Integer) As Boolean

Even = (I Mod 2) - 1
If Even = 0 Then
    IsEven = False
    IsEven = True
End If

End Function
Sub Test()
Dim I As Integer
Dim Even As Boolean

I = 1
'I = 2

Even = IsEven(I)
If Even = True Then
    MsgBox "Even"
ElseIf Even = False Then
    MsgBox "Odd"
End If

End Sub
  • No labels