Three easy functions.

Im a beginner. I need to know how to create three funtions that will do this:
First Function:
Tells you if the number inputed is odd
Second Function:
Tells you the positoin of the alpahbet that the letter is inputed (i.e if the letter D is inputed then itll return 4)
Third Function:
Swap two variables using BelVal (what ever that is) Return boolean

Thanks for help!!!
cdc_sickleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

trilloCommented:
Option Explicit

Private Sub Form_Click()
    'Test
    Dim a As Integer, b As Integer
    a = 3
    b = 4
    Me.Print IsOdd(3)
    Me.Print AlfaPos("a")
    Me.Print "A="; a; "B="; b;
    Call Swap(a, b)
    Me.Print "Swapped: "; "A="; a; "B="; b;
End Sub


Private Function IsOdd(inum As Integer) As Boolean
    IsOdd = Not (inum Mod 2)
End Function

Private Function AlfaPos(iLetter As String) As Integer
    Dim alfa As String
    alfa = "abcdefghijklmnopqrstuvwxyz"
    AlfaPos = InStr(alfa, iLetter)
End Function

Private Function Swap(ByRef a As Integer, ByRef b As Integer) As Boolean
    Dim tmp As Integer
    tmp = a
    a = b
    b = tmp
    Swap = True
End Function


Is this what you want?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
trilloCommented:
Actually, in my answer.... the swap function does not use ByVal, because it's impossible to swap two numbers, when passing them as ByVal arguments and returning a Boolean variable. They should be passes ByRef.
0
cdc_sickleAuthor Commented:
Thank you so much!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.