Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting key from collection
Message
De
21/03/2011 19:11:44
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Getting key from collection
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01504426
Message ID:
01504426
Vues:
92
I have a situation where each object added in a collection is an object in itself, thus, it contains several items. For example, I can have this:
Dim loObject(4) As Object

loObject(1) = "Member"
loObject(2) = 12
loObject(3) = "62 Somewhere"
loObject(4) = 34

oTable.Add(loObject, lnKey)
Now, when I scan this collection, I need to get the key of a specific object I am looking for in it:
' For each item in the collection
For Each loObject In oTable
   lcTable = loObject(1)

   ' If this is the table
   If UCase(tcTable) = UCase(lcTable) Then
      lnKey = ...
      Exit For
   End If

Next
How can I adjust the "lnKey = " line to obtain the key of the loObject I just collected from the oTable scan I am doing?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform