Constructs a DlxSort object.

syntaxSyntax:
new DlxSort(mode, compareCase)

Parameters

Parameter Description
mode Comparison mode. Must be one of the following values:
DlxApp.SORT_STRING
DlxApp.SORT_TEXT
DlxApp.SORT_TEXTFIRSTINT
DlxApp.SORT_TEXTLASTINT
DlxApp.SORT_TEXTINT
DlxApp.SORT_INTORTEXT
compareCase Specify false to ignore the difference between uppercase and lowercase letters, otherwise specify true.

Remarks

 

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