List.elements Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the number of elements in a list.
public:
int elements();
public int elements ();
member this.elements : unit -> int
Public Function elements () As Integer
Returns
The number of elements in the list.
Remarks
The following example creates a list of integers and adds some elements to it. The elements method is used to test whether there are three elements in the list.
{
List il = new List(Types::Integer);
il.addStart(1);
il.addStart(2);
il.addStart(3);
if (il.elements() != 3)
{
print "Something is wrong...";
}
}