How do you write a dll that passes back an Array?

P

Peter

How do you write a dll that passes back an array.

'For example I create a Recordsset.
Colum A
Value1
Value2
Value3
'Create Array
Dim MyArray(2) as sring
'Assign values
MyArray(0) = ...field("Value1")
MyArray(1) = ...field("Value2")
MyArray(0) = ...field("Value3")

now I want to return all values.... What is the class structure for this...
 
A

Armin Zingler

Peter said:
How do you write a dll that passes back an array.

'For example I create a Recordsset.
Colum A
Value1
Value2
Value3
'Create Array
Dim MyArray(2) as sring
'Assign values
MyArray(0) = ...field("Value1")
MyArray(1) = ...field("Value2")
MyArray(0) = ...field("Value3")

now I want to return all values.... What is the class structure for
this...

"class structure"?

Declare the member type "As String()", e.g.

public function test() As String()

'...
return MyArray
end function


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Peter) scripsit:
How do you write a dll that passes back an array.

'For example I create a Recordsset.
Colum A
Value1
Value2
Value3
'Create Array
Dim MyArray(2) as sring
'Assign values
MyArray(0) = ...field("Value1")
MyArray(1) = ...field("Value2")
MyArray(0) = ...field("Value3")

now I want to return all values.... What is the class structure for this...

\\\
Public Function Foo() As String()
Dim astr(9) As String
astr(0) = ...
...
Return astr
End Function
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top