473,811 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

collection(IEnu merable) of a particular type as parameter for a function

Hi All,
is there anyway i can take collection(IEnu merable) of a particular
type as a paramter for a function.
Thanks in advance.

Jul 26 '07 #1
4 1545
I am using vb.net .net 1.1.
On Jul 26, 1:49 pm, parez <psaw...@gmail. comwrote:
Hi All,

is there anyway i can take collection(IEnu merable) of a particular
type as a paramter for a function.
Thanks in advance.

Jul 26 '07 #2
do you mean to say, that you need to be sure the collection can only
be passed to the function if it's of a the type ZZZ (the one you
need) ??
Jul 26 '07 #3
On Jul 26, 2:38 pm, Kysonel <boupie...@gmai l.comwrote:
do you mean to say, that you need to be sure the collection can only
be passed to the function if it's of a the type ZZZ (the one you
need) ??
well. it could be any kind of collection ..but it should only contain
the type zzz

Jul 26 '07 #4
I don'T really get what you're trying to accomplish.... but... if you
want to be sure that the collection is containing objects of a certain
type only, then you could make a validation at the beginning of your
function like this

Private Function getValue(byref coll as Collection) As Boolean
Dim value As Boolean = true
For Each obj As Object In coll
If Not TypeOf(obj) Is GetType(ZZZ) Then
MsgBox("Collect ion containing objects different from type ZZZ")
value = false
End If
Next
return value
End Function

Jul 27 '07 #5

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

Similar topics

2
2671
by: Sean Carey | last post by:
I converted a C# Upload app to VB.NET and am down to one error and was hoping someone could help me with te error. I would greatly appreciate help from anyone. Here is the error: c:\inetpub\wwwroot\admin\filemanager.aspx.vb(76): Expression is of type 'System.Web.UI.HtmlControls.HtmlInputFile', which is not a collection type.
1
2006
by: 12jumper | last post by:
Hi All :) I've created an UserControl, which has a couple of properties that are collections (generic lists of some objects). It would be nice, if control refreshed each time I add a new item to the collection (using StringCollectionEditor). Is there any attribute I can use, or perhaps I have to create a new class that inherites from List<Tand subscribe on some event? Any suggestions greatly appreciated. Greetings
1
1913
by: clintonG | last post by:
I'm wondering if a collection would be useful for RSS files and which collection type would be used? Some RSS elements are lists themselves. Why an I thinking of a collection? To build a reusable data structure that can be populated with a form when needing to write the XML to disk and shred each element to a relational database.
1
1586
by: Lobo | last post by:
I'm wondering how expensive and (in)efficient is to use Collection type javascript library functions (similar to using Blocks), instead of repeating the 'for' iterator over and over across a large application. I'm afraid that instantiating javascript Functions to act as Blocks in these cases might require many more internal javascript resources (time / memory) compared to using the 'for' statement - ?. I would not want this to be the...
0
10651
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
10392
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...
0
10136
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5555
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...
1
4341
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
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
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.