473,326 Members | 2,061 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,326 software developers and data experts.

Easy "as object" question

I'm sure I'm just missing something here but is there a way to nest
objects inside an object or a collection that functions like an object
with properties BESIDES creating whole classes or making public
variables?

Private Sub Click()
Dim x as SomeSortOfCollection
msg box(x.Name & " " & x.Phone)
End Sub

Private Function Person() as SomeSortOfCollection
Dim Name as String= "John"
Dim Phone as String = "888-888-8888"
Person.Add(Name)
Person.Add(Phone)
End Function
What I'm not looking for:
Anything using a for each method
Using a key value like SomeObject("Name").value

Jul 29 '07 #1
2 1290
"sh********@yahoo.com" <sh********@yahoo.comwrote in
news:11*********************@r34g2000hsd.googlegro ups.com:
What I'm not looking for:
Anything using a for each method
Using a key value like SomeObject("Name").value
It's called a Dictionary/Hashtable :-)

Take a look at the System.Collections Namespace.
Jul 29 '07 #2

<sh********@yahoo.comwrote in message
news:11*********************@r34g2000hsd.googlegro ups.com...
I'm sure I'm just missing something here but is there a way to nest
objects inside an object or a collection that functions like an object
with properties BESIDES creating whole classes or making public
variables?

Private Sub Click()
Dim x as SomeSortOfCollection
msg box(x.Name & " " & x.Phone)
End Sub

Private Function Person() as SomeSortOfCollection
Dim Name as String= "John"
Dim Phone as String = "888-888-8888"
Person.Add(Name)
Person.Add(Phone)
End Function
What I'm not looking for:
Anything using a for each method
Using a key value like SomeObject("Name").value

You can use a strong type collection of objects. You can load the collection
with the objects.

You can create a function/method within the collection object to search for
object based on the value looking for and either stop on the object and
address the object or have the object returned from the collection so that
you can address its values.

You can use a for each loop in the function/method within the collection.

The one object call it NamePhone would contain property Let and Get for the
Name and Phone properties, and one NamePhone object is loaded into the
collection for each NamePhone object populated.

Jul 29 '07 #3

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

Similar topics

49
by: Ville Vainio | last post by:
I don't know if you have seen this before, but here goes: http://text.userlinux.com/white_paper.html There is a jab at Python, though, mentioning that Ruby is more "refined". -- Ville...
27
by: Curious Angel | last post by:
I have a resume in PDF format and I want anyone who LEFT-OR-RIGHT clicks the link to force the file to be saved, and in any event _not_ opened. Since the PDF will be in his cache in any event, I...
22
by: Dr Duck | last post by:
GDay all, Something seems odd to me.... I wrote a simple C# function public void bind(ref object a, ref object b, bool atob) { if(atob) b = a; else
4
by: Jian H. Li | last post by:
Hello, What's the essential differences between the two ways of "class::member" & "object.member"(or object_pointer->member)? class C{ public: void f() {} int i; };
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
1
by: Paul Tomlinson | last post by:
Question about a System.Threading.Timer object and the "state" object you pass to it... Timer stateTimer = new Timer( = new TimerCallback( OnTimer ), o, 1000, 1000); I have an array of timer...
4
by: AMP | last post by:
Hello, I want to use a ready made class (ie a System.Drawing .Pen) and make it available to my entire application, but I'm getting stupid. How do I do this? Or point me in the right direction....
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
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)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.