How to return array of object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
* =?Utf-8?B?QWxp?= said:
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) = ...'.
 
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
 
Back
Top