| Login

Search this Blog


Links I like to keep around


Here are the most recent postings to this blog. Use the archive calendar or search to find other entries.
Nov22

Written by:R Teachout
11/22/2006 7:21 PM 

Simple, but effective way to sort a dictionary object

Function SortDict(ByVal objDict)
 'Call using "Set objDictSorted = SortDict(objDict)"
 
 Dim i, j, temp
 
 For Each i In objDict
  For Each j In objDict
   If(objDict.Item(i) <= objDict.Item(j)) Then
    temp = objDict.Item(i)
    objDict.Item(i) = objDict.Item(j)
    objDict.Item(j) = temp
   End If
  Next
 Next

 'For Each i In objDict
 ' WScript.Echo objDict.Item(i)
 'Next

 Set SortDict = objDict

End Function

Tags:

1 comment(s) so far...

Re: VBScript: Sort a VBS Dictionary Object

Thanks!
Just what I was looking for

By mosaic on  4/6/2007 7:28 AM

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment  Cancel 

In an open world, who needs Windows or Gates
-Unknown

Inspired by Nina