Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   send array into function (http://www.go4expert.com/forums/send-array-function-t5238/)

chico1st 13Jul2007 03:00

send array into function
 
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.

munkyeetr 13Jul2007 03:33

Re: send array into function
 
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.

chico1st 13Jul2007 19:23

Re: send array into function
 
thanks that worked well

chico1st 13Jul2007 19:24

Re: send array into function
 
if i knew how to mark this as solved i would.

shabbir 13Jul2007 19:48

Re: send array into function
 
Quote:

Originally Posted by chico1st
if i knew how to mark this as solved i would.

We purposefully don't have that because its not just about Q&A but its something where you discuss.

munkyeetr 13Jul2007 21:03

Re: send array into function
 
Quote:

Originally Posted by chico1st
thanks that worked well

anytime


All times are GMT +5.5. The time now is 17:42.