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

How to load an object's property which is an array list?

I have an object which I set up like this:
Public Class Person
....
Protected m_timelists as ArrayList
....
Property timelists() as ArrayList
Get
timelists = m_timelists
End Get
Set (ByVal Value as ArrayList)
m_timelists = Value
End Set
End Property

Is this legal and valid??? If yes, keep going:
Now I want to set it with some objects:

PersonList.addtimeobject(myUserid, time) 'Time object is previously created
and valid

Public Class PersonList
Dim personlist as new ArrayList 'To hold all the person objects
....
Public Function addtimeobject(ByVal userid as string, ByVal time as object)
Dim i as integer = 0
For i = 0 to personlist.count-1
if personlist(i).userid = userid then
personlist(i).timelists.add(time)
end if
Next
End Function

Error returned: Object variable or With block variable not set. This is
occurring on the timelists Arraylist Property Get and Set areas.

Can someone assist???? Thanks!
Nov 20 '05 #1
2 1813
"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> schrieb
I have an object which I set up like this:
Public Class Person
...
Protected m_timelists as ArrayList
...
Property timelists() as ArrayList
Get
timelists = m_timelists
End Get
Set (ByVal Value as ArrayList)
m_timelists = Value
End Set
End Property

Is this legal and valid???
Yes, but in the example you never assign anything to the timelists property,
so m_timelists is still Nothing and you get...
Error returned: Object variable or With block variable not set.
This is occurring on the timelists Arraylist Property Get and Set
areas.


.... this error.

Declare
Protected m_timelists as NEW ArrayList
or assign an arraylist to the timelists property.
--
Armin

Nov 20 '05 #2
AHHHHHHHH - many many thanks, wonderful and thanks again!

Derek

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> schrieb
I have an object which I set up like this:
Public Class Person
...
Protected m_timelists as ArrayList
...
Property timelists() as ArrayList
Get
timelists = m_timelists
End Get
Set (ByVal Value as ArrayList)
m_timelists = Value
End Set
End Property

Is this legal and valid???
Yes, but in the example you never assign anything to the timelists

property, so m_timelists is still Nothing and you get...
Error returned: Object variable or With block variable not set.
This is occurring on the timelists Arraylist Property Get and Set
areas.


... this error.

Declare
Protected m_timelists as NEW ArrayList
or assign an arraylist to the timelists property.
--
Armin

Nov 20 '05 #3

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

Similar topics

54
by: tshad | last post by:
I have a function: function SalaryDisplay(me) { var salaryMinLabel = document.getElementById("SalaryMin"); salaryMinLabel.value = 200; alert("after setting salaryMinLabel = " +...
6
by: Luke | last post by:
Here is my emails to Danny Goodman (but probably he is very busy so he didn't answered it). First email(simple): Subject: JavaScript Arrays " We all know the array can act like HashMap, but is...
38
by: VK | last post by:
Hello, In my object I have getDirectory() method which returns 2-dimentional array (or an imitation of 2-dimentional array using two JavaScript objects with auto-handled length property - please...
3
by: Poewood | last post by:
Okay here are four classes for a pocket pc program: Input, fpositional, ComboBoxArray and TextBoxArray. The "input" class is the form. I use the fpositional class to handle most of the functions...
4
by: Derek Martin | last post by:
I have an object which I set up like this: Public Class Person .... Protected m_timelists as ArrayList .... Property timelists() as ArrayList Get timelists = m_timelists End Get Set (ByVal...
0
by: a | last post by:
I need to create an instance of a custom object 'School.Teacher' and use it in a Profile object. I'm developing a bad case of "Pretzel Logic" thinking about this. Filling the custom object ...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
1
by: aeshiels | last post by:
Hopefully I have the correct newsgroup for this question. I've developed a very simple COM server in C++ as im trying to learn COM. The COM server has an array of IUnknown interfaces (MyArray)...
4
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello, I have a list of entities (with properties Key and Description). Which is the best manner of load dropdownlist with this list ? Thanks in advance --...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.