Click here to Skip to main content
15,920,704 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Default return value? Pin
DaveAuld28-Nov-09 22:18
professionalDaveAuld28-Nov-09 22:18 
GeneralRe: Default return value? Pin
Luc Pattyn29-Nov-09 0:16
sitebuilderLuc Pattyn29-Nov-09 0:16 
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 
I am trying to get the index of an object in an Arraylist. Please see my example. When run I get -1 for the values of Indexof.

I am sure this is a rookie error but any help would be appreciated.

Cheers

Public Class Plateobj

Public Name As String
Public Order As Integer

End Class


Private Sub Go()

Dim Plate As New Plateobj
Dim List As New ArrayList

'Populate arraylist

Plate.Name = "Geoff"
Plate.Order = 3
List.Add(Plate)

Plate = New Plateobj
Plate.Name = "Dan"
Plate.Order = 2
List.Add(Plate)

Plate.Name = "Paul"
Plate.Order = 1
List.Add(Plate)

'Locate the index of each of the following

MessageBox.Show(List.IndexOf(Plate), "Paul")

Plate = New Plateobj
Plate.Name = "Dan"
Plate.Order = 1

MessageBox.Show(List.IndexOf(Plate), "Dan")

Plate = New Plateobj
Plate.Name = "Geoff"
Plate.Order = 3

MessageBox.Show(List.IndexOf(Plate), "Geoff")

End Sub

modified on Friday, November 27, 2009 6:36 AM

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 
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 

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.