Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fastest way to sort a collection
Message
De
31/01/2013 13:35:38
 
 
À
31/01/2013 12:22:07
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01564757
Message ID:
01564873
Vues:
42
>It is a VB.NET line. Works for me. Try this (modified to use Rob's 'OrderByDescending):
Module Module1
>
>   public oParametersDataDictionaryField As New Collection()
>
>    Sub Main()
>
>    	ParameterAddDataDictionaryField("One", 5)
>		ParameterAddDataDictionaryField("Two", "Hello")
>		ParameterAddDataDictionaryField("Alpha", DateTime.Now)
>		ParameterAddDataDictionaryField("Zebra", "Hello")
>
>		Dim result = oParametersDataDictionaryField.OfType(Of Object())().OrderByDescending(Function(x) x(0))
>	End Sub
>
>  Private  Function ParameterAddDataDictionaryField(tcField As String, toValue As Object) As Boolean
>		oParametersDataDictionaryField.Add(New Object(4) {tcField, toValue, "", "", 0})
>		Return True
>	End Function
>End Module
I really do not know how you can achieve that line to be understood by the designer. Here is what I have:
        Public oDirectory As Collection = New Collection
And, then, in my client class:
        Dim result = loFTP.oDirectory.OfType(Of Object())().OrderByDescending(Function(x) x(0))
And the designer says:

"'OfType' is not a member of 'Microsoft.VisualBasic.Collection'."
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform