Gets the number of items in the list.
Syntax: |
---|
DlxSort.GetCount() |
Return Value
Returns the number of items in the list.
Example
Copy code | |
---|---|
var project = DlxApp.GetJob().GetProject();
if (!project.IsValid())
{
throw new Error("Project not found.");
}
var netlist = project.GetNetlist();
if (!netlist.IsValid())
{
throw new Error("Invalid netlist.");
}
var devicesort = new DlxSort(DlxApp.SORT_TEXTFIRSTINT, false);
for (var i = 0; i < netlist.GetDeviceCount(); i++)
{
var device = netlist.GetDevice(i);
devicesort.AddString(device.GetReference(), i);
}
devicesort.Sort();
DlxApp.Printf("*** Component List ***");
for (i = 0; i < devicesort.GetCount(); i++)
{
device = netlist.GetDevice(devicesort.GetData(i));
DlxApp.Printf(DlxApp.Format("%s (%s)", devicesort.GetString(i), device.GetValue()));
}
|