473,508 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting an array structure from a Class property

Hi,
I am creating a class. I do not have any problem defining the property
statements except when an array is involved. Would someone be able to show
me the correct syntax for a Property statement to Get an entire array
instead of one element of the array.

thanks,
hugh
Nov 21 '05 #1
3 1401
Can a function returning array suffice ?

Kalpesh
Nov 21 '05 #2
http://www.developerfusion.co.uk/show/1047/2/
"Hugh O" <Hu****@newsgroup.nospam> wrote in message
news:ej*************@tk2msftngp13.phx.gbl...
Hi,
I am creating a class. I do not have any problem defining the property
statements except when an array is involved. Would someone be able to
show me the correct syntax for a Property statement to Get an entire array
instead of one element of the array.

thanks,
hugh

Nov 21 '05 #3
Hugh,
In addition to the other comments:

When arrays are involved I normally make the property readonly, something
like:

Public Class Person

Public ReadOnly Property Children() As Person()
Get

End Get
End Property

End Class

Note the type is "Person()" which indicates an Array Of Person. Where as
Variables can be defined either as:

Dim people() As Person

Dim people As Person()

Both of the above lines indicates an Array Of Person.
Sometimes I will define an indexed (parameterized) property instead of an
array property:

Public Class Person

Public ReadOnly Property Children(ByVal index As Integer) As Person
Get

End Get
End Property

End Class
--
Hope this helps
Jay
T.S. Bradley - http://www.tsbradley.net
"Hugh O" <Hu****@newsgroup.nospam> wrote in message
news:ej*************@tk2msftngp13.phx.gbl...
| Hi,
| I am creating a class. I do not have any problem defining the property
| statements except when an array is involved. Would someone be able to
show
| me the correct syntax for a Property statement to Get an entire array
| instead of one element of the array.
|
| thanks,
| hugh
|
|
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2982
by: Julian | last post by:
Hi, I am using PHP 4 with classes but I have come across a slight problem... I can't declare an array as a property of a class, ie, class clTest { var $a; clTest()
2
2825
by: akshay4friend | last post by:
Hi, I am creating a structure / class having data type like { DOUBLE x; DOUBLE y; DOUBLE z; }POINT3D; now my data is stored in a file..so i need to create buffer to read
5
2058
by: Laszlo Zsolt Nagy | last post by:
Hughes, Chad O wrote: > Is there any way to create a class method? I can create a class > variable like this: > Hmm, seeing this post, I have decided to implement a 'classproperty'...
3
2672
by: Faustino Dina | last post by:
Hi, The following code is from an article published in Informit.com at http://www.informit.com/guides/content.asp?g=dotnet&seqNum=142. The problem is the author says it is not a good idea to...
3
11454
by: simonc | last post by:
Can you define a property as type Byte array of a specific length? I am trying to pass a byte array which is 3200 bytes in length from one form (in which the bytes are read from a file) to...
12
2660
by: Saurabh Kumar | last post by:
I have a byte array, which i need to send to a class, where it will be stored in an arraylist. I use the following property in the class to accept the byte array, but it seems that the array is...
3
6108
by: Ant | last post by:
Hi, I'm using the tag property of the Treenode object to store an string array containing some values. I can assign it to the Tag but when I try to retrieve values from it I get an error:...
5
4732
by: Lyle Avery | last post by:
Hello guys, Look at this in c++ file: class T { public: char c; char ca; };
10
6344
by: Scott Townsend | last post by:
So I need to talk to a devices that expects all of the bits and bytes I sent it to be in specific places (not yet 100% defined). I wanted to create a structure/class with all of the data in it...
4
1783
by: Etienne-Louis Nicolet | last post by:
I am working on an error handler class. Within a property set method of a given class property I'd like to pass the PropertyInfo to a function. Imagine something like: Public Class MyClass .......
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.