473,666 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.addt imeobject(myUse rid, 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(B yVal userid as string, ByVal time as object)
Dim i as integer = 0
For i = 0 to personlist.coun t-1
if personlist(i).u serid = userid then
personlist(i).t imelists.add(ti me)
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 1830
"Derek Martin" <dm*****@DONTSP AMMEokstate.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*******@free net.de> wrote in message
news:40******** *************** @news.freenet.d e...
"Derek Martin" <dm*****@DONTSP AMMEokstate.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
4560
by: tshad | last post by:
I have a function: function SalaryDisplay(me) { var salaryMinLabel = document.getElementById("SalaryMin"); salaryMinLabel.value = 200; alert("after setting salaryMinLabel = " + salaryMinLabel.value); } I also have an asp.net object:
6
2331
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 there a shortcut for creating such array ? eg //simple array indexed via numbers var a = new Array("a", "fdsf", "sada"); or,
38
5187
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 let's us do not go into an "each dot over i" clarification discussion now - however you want to call - you call it ;-) array contains records of all files in the current dir. array contains records of all subs in the current dir
3
3166
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 for the objects on the form, in addition the The objects are created in the fpositional class and affixed to the Input form through the fpositional constructor which takes the form as an argument. The ComboBox and TextBox Array classes hold the...
4
417
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 Value as ArrayList)
0
1831
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 'School.Teacher' as an ArrayList creates the proper information (see aspx code below), but I'm unable to use this ArrayList in the Profile object. The aspx code below shows the attempt and error message.
26
5669
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 several parts of the DOM, but this does not include the window object. Thank you
9
3784
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 techniques are not feasible) The question is; Given that I have a Person object with a private set for id. What is the recommended approac in passing that object to the web service
1
3491
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) where im allowing the user to store COM objects (derived from IUnknown) via get/put properties. I have a created a COM object which is derived from IUnknown but when i come to add the object to my array from C# i get a com exception : "Unable to...
4
5681
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 -- http://www.alhambra-eidos.es/web2005/index.html www.kiquenet.net
0
8363
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8883
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8787
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8561
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5672
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1778
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.