473,382 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 1664
* =?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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Asad Khan | last post by:
Hello, I am writing a method that returns an array as an Object. Initially there is a single dimension array Object X. However, I can insert other arrays as Objects in X, thus I can end up with...
5
by: Andrew Poulos | last post by:
If I'm searching for an occurance of a value in a multi-dimensional array how can I get it's index returned as an array, if found? For example, if: foo = new Array(); foo = , 5, , 9, 10]; ...
8
by: M. Moennigmann | last post by:
Dear all: I would like to write a function that opens a file, reads and stores data into an 2d array, and passes that array back to the caller (=main). The size of the array is not known before...
0
by: JL_327 | last post by:
No one on any of the other boards seem to know In VB.Net this late binding works fine Dim Version As Integer Dim Revision As Integer Dim Wnum As Integer Dim o As System.Array =...
1
by: Pradeep Kumar | last post by:
I have a scenario where I am writing a property(using get and set) have to return a member of an object stored in an array of objects! The class user has to pass an index based on which a object i's ...
7
by: nafri | last post by:
hello all, I want to create a function that returns the first element of the Array that is input to it. However, the Input Array can be an Array of points, double, or anyother type, which means...
4
by: yxq | last post by:
In VB2005. Dim a() As Object = {10, 4} Dim b() As Byte = {10, 4} MessageBox.Show(a.Equals(b)) Why return False, but not Ture? Thank you
19
by: Andrew Gentile | last post by:
Hello, I have been working on a program where I need to have a function return an array. I found out that C doesn't do this, so now I am trying to get the function to return a pointer to an...
20
by: Andrew Morton | last post by:
Is it possible to have two function declarations which take the same parameters but return different types depending on how the function is used? function f(x) as string ' return a string end...
3
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I have a simple question. I have a function that I want to return an array. I want the array to be other objects that were instantiated in the function itself. What's the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.