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

collection(IEnumerable) of a particular type as parameter for a function

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

Jul 26 '07 #1
4 1521
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(IEnumerable) 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...@gmail.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("Collection 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
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: ...
1
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...
1
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...
1
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...
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: 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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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...
0
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...

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.