1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

send array into function

Discussion in 'Visual Basic ( VB )' started by chico1st, Jul 12, 2007.

  1. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    I cant send an array into my function.. i havent used VB in a while, can you tell me what is wrong with my code

    Function Leave(Channel(1 to 20) as String) as Double


    thank you for your time.
     
  2. munkyeetr

    munkyeetr New Member

    Joined:
    May 4, 2007
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Victoria BC, Canada
    If I remember correctly with VB6 you would send an array to a function using:

    The declaration and function contents
    Code:
    Function Leave(Channel() as String) as Double
       ...some code the function processes
       End Function
        
    The call:
    Code:
       Dim retval as Double ' return value
       Dim Channel(20) as String ' array of 20 strings
       
     retval = Leave(Channel)
       
    Not sure which VB you are using, but give it a try.
     
  3. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    thanks that worked well
     
  4. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    if i knew how to mark this as solved i would.
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    We purposefully don't have that because its not just about Q&A but its something where you discuss.
     
  6. munkyeetr

    munkyeetr New Member

    Joined:
    May 4, 2007
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Victoria BC, Canada
    anytime
     

Share This Page