Click here to Skip to main content
15,891,951 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Default return value? Pin
Shameel29-Nov-09 23:20
professionalShameel29-Nov-09 23:20 
AnswerRe: Default return value? Pin
Tom Deketelaere30-Nov-09 1:47
professionalTom Deketelaere30-Nov-09 1:47 
QuestionVBA on Excel Query Pin
Dalek Dave27-Nov-09 4:54
professionalDalek Dave27-Nov-09 4:54 
AnswerRe: VBA on Excel Query Pin
EliottA27-Nov-09 5:14
EliottA27-Nov-09 5:14 
GeneralRe: VBA on Excel Query Pin
Dalek Dave27-Nov-09 5:18
professionalDalek Dave27-Nov-09 5:18 
QuestionArraylist.Index(Object) help please. [modified] Pin
Geoff_300126-Nov-09 23:23
Geoff_300126-Nov-09 23:23 
AnswerRe: Arraylist.Index(Object) help please. Pin
Luc Pattyn27-Nov-09 0:18
sitebuilderLuc Pattyn27-Nov-09 0:18 
AnswerRe: Arraylist.Index(Object) help please. Pin
The Man from U.N.C.L.E.27-Nov-09 0:38
The Man from U.N.C.L.E.27-Nov-09 0:38 
You are generating new plate objects for comparison, however IndexOf does an object comparison. The newly created objects will never match anything in your list.

What Indexof is doing is iterating through the list calling Equals to compare each object in turn. The only way your comparison can work is to override the Equals method on your PlateObj. E.g.

VB
Public Overrides Function Equals(ByVal obj As Object) As Boolean
   Dim plate As Plateobj = TryCast(obj, Plateobj)

   '   Return False if the obj is not a plate
   If plate Is Nothing Then Return False

   '   Must have same name
   If plate.Name <> Me.Name Then Return False

   '   Must have same order
   If plate.Order <> Me.Order Then Return False

   '   We have a match
   Return True
End Function


If only the names need to match then only compare the names.

If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
[My Articles]  [My Website]

GeneralRe: Arraylist.Index(Object) help please. Pin
Geoff_300127-Nov-09 1:21
Geoff_300127-Nov-09 1:21 
Questionget and compare ascii code in vb.Net Pin
negar karimi26-Nov-09 22:46
negar karimi26-Nov-09 22:46 
AnswerRe: get and compare ascii code in vb.Net Pin
dan!sh 26-Nov-09 23:14
professional dan!sh 26-Nov-09 23:14 
GeneralRe: get and compare ascii code in vb.Net Pin
negar karimi27-Nov-09 21:09
negar karimi27-Nov-09 21:09 
GeneralRe: get and compare ascii code in vb.Net Pin
dan!sh 28-Nov-09 6:09
professional dan!sh 28-Nov-09 6:09 
AnswerRe: get and compare ascii code in vb.Net Pin
Shameel26-Nov-09 23:14
professionalShameel26-Nov-09 23:14 
AnswerRe: get and compare ascii code in vb.Net Pin
Luc Pattyn27-Nov-09 0:24
sitebuilderLuc Pattyn27-Nov-09 0:24 
QuestionArrange database Column entries by ascending order. Pin
jeshra27926-Nov-09 19:19
jeshra27926-Nov-09 19:19 
AnswerRe: Arrange database Column entries by ascending order. Pin
dan!sh 26-Nov-09 19:30
professional dan!sh 26-Nov-09 19:30 
AnswerRe: Arrange database Column entries by ascending order. Pin
Shameel26-Nov-09 19:46
professionalShameel26-Nov-09 19:46 
AnswerRe: Arrange database Column entries by ascending order. Pin
Vimalsoft(Pty) Ltd26-Nov-09 22:20
professionalVimalsoft(Pty) Ltd26-Nov-09 22:20 
Question[VB6] On Change Event issues Pin
Blake Dickson26-Nov-09 18:52
Blake Dickson26-Nov-09 18:52 
AnswerRe: [VB6] On Change Event issues Pin
Shameel26-Nov-09 19:50
professionalShameel26-Nov-09 19:50 
AnswerRe: [VB6] On Change Event issues Pin
Vimalsoft(Pty) Ltd26-Nov-09 22:09
professionalVimalsoft(Pty) Ltd26-Nov-09 22:09 
QuestionSelecting MAX value from a Database column. Pin
jeshra27926-Nov-09 18:35
jeshra27926-Nov-09 18:35 
AnswerRe: Selecting MAX value from a Database column. Pin
dan!sh 26-Nov-09 19:15
professional dan!sh 26-Nov-09 19:15 
AnswerRe: Selecting MAX value from a Database column. Pin
Shameel26-Nov-09 19:53
professionalShameel26-Nov-09 19:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.