469,572 Members | 1,287 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

How to return array of object

Ali
hi i need to send some data to the function and want to return array of object bac
lik

dim obj() as myclass=AddIt(i,j
i dont know that is write syntax or no

public function addit(byval i as interger, byval j as integer) as myclas
dim obj(20) as myclas
obj(0).additem( i,j
obj(1).additem(i,j
Nov 20 '05 #1
2 1445
* =?Utf-8?B?QWxp?= <an*******@discussions.microsoft.com> scripsit:
hi i need to send some data to the function and want to return array of object back
like

dim obj() as myclass=AddIt(i,j)
i dont know that is write syntax or not

public function addit(byval i as interger, byval j as integer) as
myclass
'... As MyClass()'.
dim obj(20) as myclass
obj(0).additem( i,j)
obj(1).additem(i,j)
.
.
obj(20).additem(i,j)
'obj(i) = ...'.
return obj
end function
if some body give me help how to do that


--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
You should add parenthesis to the return object...
Syntax sample below

Your implmentation of AddIt
public function addit(byval i as interger, byval j as integer) as myclass

Corrected AddIt
Public Function AddIt(ByVal i As Integer, ByVal j As Integer) as myClass()

Hope it helps
--

Poolbeer (MCP)

"Ali" <an*******@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
hi i need to send some data to the function and want to return array of object back like

dim obj() as myclass=AddIt(i,j)
i dont know that is write syntax or not

public function addit(byval i as interger, byval j as integer) as myclass
dim obj(20) as myclass
obj(0).additem( i,j)
obj(1).additem(i,j)
.
.
obj(20).additem(i,j)
return obj
end function
if some body give me help how to do that

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Asad Khan | last post: by
5 posts views Thread by Andrew Poulos | last post: by
8 posts views Thread by M. Moennigmann | last post: by
7 posts views Thread by nafri | last post: by
4 posts views Thread by yxq | last post: by
19 posts views Thread by Andrew Gentile | last post: by
20 posts views Thread by Andrew Morton | last post: by
3 posts views Thread by =?Utf-8?B?VHJlY2l1cw==?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.