VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Even or Odd Function, Run a number to see if its Even or odd. TIDY

by Jack Jarvis (6 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 28th August 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Even or Odd Function, Run a number to see if its Even or odd. TIDY

API Declarations



'Call it like
'Msgbox evenodd("65")
'or msgbox evenodd(text1.text)

Rate Even or Odd Function, Run a number to see if its Even or odd. TIDY



Dim theintr, i, intlen As Double
theintr = thestring / 2
intlen = Len(theintr)
i = 1
For it = 1 To intlen
If Mid(theintr, i, 1) = "." Then
evenodd = "ODD"
Else
i = i + 1
evenodd = "EVEN"
End If
Next it
End Function

Download this snippet    Add to My Saved Code

Even or Odd Function, Run a number to see if its Even or odd. TIDY Comments

No comments have been posted about Even or Odd Function, Run a number to see if its Even or odd. TIDY. Why not be the first to post a comment about Even or Odd Function, Run a number to see if its Even or odd. TIDY.

Post your comment

Subject:
Message:
0/1000 characters