Collection.Collection Constructor

Creates and returns a new Visual BasicCollection Object (Visual Basic).

Namespace: Microsoft.VisualBasic
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)

public Collection ()
public Collection ()
public function Collection ()
Not applicable.

The Visual Basic collection returned by this constructor is empty and does not have any initial capacity allocated.

Visual Basic collections are not compatible with the .NET Framework collections available in the System.Collections, System.Collections.Generic, and System.Collections.Specialized namespaces.

The following example creates a new Visual Basic collection and assigns it to the variable coll:

Dim coll As New Microsoft.VisualBasic.Collection()

This Collection object is one-based, which means that the index values of the elements range from 1 through the value of the Count property. Visual Basic collections hold elements of type Object.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0