Adds a new item to the list.

syntaxSyntax:
DlxSort.AddString(name, value)

Parameters

Parameter Description
name Item name.
value Item value.

Return Value

If the operation ends correctly, it returns true otherwise it returns false.

Example

  Copy codeCopy 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()));
}

See also