tvb2727

How do you pass an array. I am going to write a DLL file and i want to return an array from that file to my program.


Re: Visual Basic Language Passing an array

Stanley1271

Make the return type as Array.





Re: Visual Basic Language Passing an array

tvb2727

Can you give me some example code





Re: Visual Basic Language Passing an array

Stanley1271

Code Block

Public Function myPublicFunctionThatReturnsAnArray() As Array

Dim myInternalArray(3) As Array 'dim with 4 spaces

'do something here with the array

Return myInternalArray

End Function





Re: Visual Basic Language Passing an array

tvb2727

awesome...thanks.





Re: Visual Basic Language Passing an array

John Oliver (UK)MSP, VSIP

Hi,

If you need to pass an array to a FUNCTION or SUB insert something like

ByVal arrayToPass As Array like this.>>

Public Function myPublicFunctionThatReturnsAnArray( ByVal arrayToPass As Array ) As Array

Dim myInternalArray() As Array = arrayToPass

'Do something here with the array

Return myInternalArray

End Function

Regards,

John