How to call function in VB 2005?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dyc
    New Member
    • May 2007
    • 32

    #1

    How to call function in VB 2005?

    Hi..may I know how to call a function inside ur main form?

    Public Function BinaryToDec(ByV al BinaryValue As String) As Long
    Do
    BinaryToDec = BinaryToDec + (Strings.Left(B inaryValue, 1) * 2 ^ (Len(BinaryValu e) - 1))
    BinaryValue = Mid(BinaryValue , 2)
    Loop Until BinaryValue = ""
    End Function

    if i want to call this function under a button eventhandler,ho w should I call it?
    i tried BinaryToDec() but there was an error occured....
  • jeffbroodwar
    New Member
    • Oct 2006
    • 118

    #2
    Hi please see the code below :

    button event click procedure
    {

    Dim test as String

    Text1.text = BinaryToDec(tes t)

    }

    Basically you lack 1 thing..

    1. your function requires a parameter, and you said you tried to call it with BinaryToDec() (inside the parenthesis you did not specify a value for your function to process

    hope this helps.....


    Best Regards,
    Jeff

    Comment

    Working...