Using .NET System.Collections.SortedList from ASP

More info about System.Collections.SortedList class at MSDN Library.

Output

3
16
3
First -> Fabio
Second -> Zendhi
Third -> Nagao

Sources

/dot-NET/System.Collections.SortedList.asp

<%@ language="VBScript" %>
<!--#include virtual="/lib/unit-tests.asp"-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="/lib/unit-tests.css" rel="stylesheet" type="text/css" />
<h1>Using .NET System.Collections.SortedList from ASP</h1>
<p>
	More info about System.Collections.SortedList class at <a href="https://msdn.microsoft.com/en-us/library/System.Collections.SortedList.aspx">MSDN Library</a>.
</p>
<h2>Output</h2>
<div class="code"><pre><%
 
' PS> new-object System.Collections.SortedList | gm | format-list > System.Collections.SortedList.txt
 
'TypeName   : System.Collections.SortedList
'Name       : Add
'MemberType : Method
'Definition : void Add(System.Object key, System.Object value),
'             void IDictionary.Add(System.Object key, System.Object value)
 
'TypeName   : System.Collections.SortedList
'Name       : Clear
'MemberType : Method
'Definition : void Clear(),
'             void IDictionary.Clear()
 
'TypeName   : System.Collections.SortedList
'Name       : Clone
'MemberType : Method
'Definition : System.Object Clone(),
'             System.Object ICloneable.Clone()
 
'TypeName   : System.Collections.SortedList
'Name       : Contains
'MemberType : Method
'Definition : bool Contains(System.Object key),
'             bool IDictionary.Contains(System.Object key)
 
'TypeName   : System.Collections.SortedList
'Name       : ContainsKey
'MemberType : Method
'Definition : bool ContainsKey(System.Object key)
 
'TypeName   : System.Collections.SortedList
'Name       : ContainsValue
'MemberType : Method
'Definition : bool ContainsValue(System.Object value)
 
'TypeName   : System.Collections.SortedList
'Name       : CopyTo
'MemberType : Method
'Definition : void CopyTo(array array, int arrayIndex),
'             void ICollection.CopyTo(array array, int index)
 
'TypeName   : System.Collections.SortedList
'Name       : Equals
'MemberType : Method
'Definition : bool Equals(System.Object obj)
 
'TypeName   : System.Collections.SortedList
'Name       : GetByIndex
'MemberType : Method
'Definition : System.Object GetByIndex(int index)
 
'TypeName   : System.Collections.SortedList
'Name       : GetEnumerator
'MemberType : Method
'Definition : System.Collections.IDictionaryEnumerator GetEnumerator(),
'             System.Collections.IDictionaryEnumerator IDictionary.GetEnumerator(),
'             System.Collections.IEnumerator IEnumerable.GetEnumerator()
 
'TypeName   : System.Collections.SortedList
'Name       : GetHashCode
'MemberType : Method
'Definition : int GetHashCode()
 
'TypeName   : System.Collections.SortedList
'Name       : GetKey
'MemberType : Method
'Definition : System.Object GetKey(int index)
 
'TypeName   : System.Collections.SortedList
'Name       : GetKeyList
'MemberType : Method
'Definition : System.Collections.IList GetKeyList()
 
'TypeName   : System.Collections.SortedList
'Name       : GetType
'MemberType : Method
'Definition : type GetType()
 
'TypeName   : System.Collections.SortedList
'Name       : GetValueList
'MemberType : Method
'Definition : System.Collections.IList GetValueList()
 
'TypeName   : System.Collections.SortedList
'Name       : IndexOfKey
'MemberType : Method
'Definition : int IndexOfKey(System.Object key)
 
'TypeName   : System.Collections.SortedList
'Name       : IndexOfValue
'MemberType : Method
'Definition : int IndexOfValue(System.Object value)
 
'TypeName   : System.Collections.SortedList
'Name       : Remove
'MemberType : Method
'Definition : void Remove(System.Object key),
'             void IDictionary.Remove(System.Object key)
 
'TypeName   : System.Collections.SortedList
'Name       : RemoveAt
'MemberType : Method
'Definition : void RemoveAt(int index)
 
'TypeName   : System.Collections.SortedList
'Name       : SetByIndex
'MemberType : Method
'Definition : void SetByIndex(int index, System.Object value)
 
'TypeName   : System.Collections.SortedList
'Name       : ToString
'MemberType : Method
'Definition : string ToString()
 
'TypeName   : System.Collections.SortedList
'Name       : TrimToSize
'MemberType : Method
'Definition : void TrimToSize()
 
'TypeName   : System.Collections.SortedList
'Name       : Item
'MemberType : ParameterizedProperty
'Definition : System.Object Item(System.Object key) {get;set;}
 
'TypeName   : System.Collections.SortedList
'Name       : Capacity
'MemberType : Property
'Definition : int Capacity {get;set;}
 
'TypeName   : System.Collections.SortedList
'Name       : Count
'MemberType : Property
'Definition : int Count {get;}
 
'TypeName   : System.Collections.SortedList
'Name       : IsFixedSize
'MemberType : Property
'Definition : bool IsFixedSize {get;}
 
'TypeName   : System.Collections.SortedList
'Name       : IsReadOnly
'MemberType : Property
'Definition : bool IsReadOnly {get;}
 
'TypeName   : System.Collections.SortedList
'Name       : IsSynchronized
'MemberType : Property
'Definition : bool IsSynchronized {get;}
 
'TypeName   : System.Collections.SortedList
'Name       : Keys
'MemberType : Property
'Definition : System.Collections.ICollection Keys {get;}
 
'TypeName   : System.Collections.SortedList
'Name       : SyncRoot
'MemberType : Property
'Definition : System.Object SyncRoot {get;}
 
'TypeName   : System.Collections.SortedList
'Name       : Values
'MemberType : Property
'Definition : System.Collections.ICollection Values {get;}
 
dim SortedList, i
 
set SortedList = Server.createObject("System.Collections.SortedList")
 
SortedList.add "Third", "Nagao"
SortedList.add "Second", "Zendhi"
SortedList.add "First", "Fabio"
 
Response.write( SortedList.count & vbNewline )
Response.write( SortedList.capacity & vbNewline )
SortedList.trimToSize()
Response.write( SortedList.capacity & vbNewline )
 
for i = 0 to ( SortedList.count - 1 )
    Response.write( SortedList.getKey(i) & " -> " & SortedList.getByIndex(i) & vbNewline )
next
 
set SortedList = nothing
 
%></pre></div>
<hr />
<h2>Sources</h2>
<h3><%= Request.ServerVariables("SCRIPT_NAME") %></h3>
<div class="code"><%= geshify( loadTextFile( Server.mapPath( Request.ServerVariables("SCRIPT_NAME") ) ), "asp" ) %></div>