473,320 Members | 1,950 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,320 software developers and data experts.

Can a Property be an array?

FOP
Hi

I'd like to know if a property can be a array of a structure in VB.NET

I have a structure called sListItem and I need a property to be an array of that type, something like

Public Property ListItems()(10) As sListItem

....that I'd call as

myClass.ListIems(i).an

I am new in VB.NET and I don't know how to declare such thing..

Any idea??

Thanks a lot!!

FO

Nov 20 '05 #1
2 1915
Fernando(?),
Didn't you ask this yesterday?

As Herfried & spamfurnace stated yesterday: yes properties can be arrays.

However you do not give the length on the property itself, you need to use
the following syntax.
Public Property ListItems() As sListItem()
An alternative is to define an Indexed Property. Something like:
Public Property ListItems(index As Integer) As sListItem
Hope this helps
Jay

"FOP" <an*******@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com... Hi,

I'd like to know if a property can be a array of a structure in VB.NET.

I have a structure called sListItem and I need a property to be an array of that type, something like:
Public Property ListItems()(10) As sListItem

...that I'd call as:

myClass.ListIems(i).any

I am new in VB.NET and I don't know how to declare such thing...

Any idea???

Thanks a lot!!!

FOP

Nov 20 '05 #2
FOP
Yes! FOP -> Fernando O. Paes :

Actually I had some kind of trouble posting this yesterday and I couldn't be sure that my topic was ok, that's why I tried in different groups..

and yes, both your comments were very helpful, my routine finally worked

Regards
FO

Nov 20 '05 #3

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

Similar topics

1
by: | last post by:
I'm going a little crazy trying to learn how to use arrays as properties in VBScript classes. Hopefully someone can help. First, I can't figure out whether it's possible to iterate through the...
16
by: sneill | last post by:
How is it possible to take the value of a variable (in this case, MODE_CREATE, MODE_UPDATE, etc) and use that as an object property name? In the following example I want 'oIcon' object to have...
5
by: Jon Maz | last post by:
Hi All, I'm reasonably proficient with C#, and am starting with php5. I was happy to learn of the __get and __set methods, but am encountering a problem using them to set an object property of...
10
by: Ding Dang | last post by:
I have been using Delphi for a few years, now using Delphi8 and VC#. I just had a preview on VC# 2.0. I was wondering why there is no array property? While there is in VB.net, Delphi.net and IL....
3
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...
3
by: Hugh O | last post by:
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...
5
by: Sam | last post by:
Hi All I have couple of question regarding property of a class and structures. **** ---- Here is my class and structure ---- ***** 1. Public Structure MyPoint 2. Dim p As Point 3. ...
6
by: pinetaj | last post by:
Hello, I have a question of using 'property' on accessing elements of array. There is an array member in a class. I'd like to restrict accessing the elements of the array through property. And...
19
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I access a property of an object using a string?...
30
by: josh | last post by:
Hi all, what does it meaning that strange sintax (look at the object :) ? if I have i.e. array.length I can use array. and is it IE/Firefox compatible??
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.