Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find if an element of a collection exists?

Status
Not open for further replies.

WomanPro

Programmer
Nov 1, 2012
180
GR
Hello everyone.
I have a simple collection of byte and I am trying to use exists method to find if an element exists on it without effect. What do I am missing?

Dim Collection() As Byte = {2, 4, 6}
Dim i As Integer
Dim x As Byte = 4

If sullogi.Exists(sullogi, x) Then
MsgBox("found")
End If

I am getting error in if statement, NullReferenceException was unhandled
What's going on there?
Could anyone help me? Any help will be much appreciated.

Thank you so much in advanced.
 

What is 'sullogi'?

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
excuse me jebenson I wanted to write Collection instead of 'sullogi'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top