DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Command: ChnMultipleSortExt

Display all  Hide all

Command: ChnMultipleSortExt

Sorts the values in data channels. DIAdem sorts texts according to the ASCII table.

Set ChnResult = ChnMultipleSortExt(ChnList1, ChnList2, MultipleSortExtOrder, MultipleSortExtCaseSensitive, MultipleSortExtIP)

Input Parameters

ChnList1 Specifies one or more channels.
ChnList2 Specifies one or more channels.
MultipleSortExtOrder Specifies whether DIAdem sorts values and text in ascending or descending order.
MultipleSortExtCaseSensitive Specifies whether and how DIAdem sorts text case-sensitively.
MultipleSortExtIP Specifies that DIAdem stores the results in the original channels.

Return Parameters

ChnResult Contains the result channel or result channels. ElementList <Data> type return value.

The channels containing values or text, which DIAdem sorts in ascending or descending order, are in the first channel list. The channels that contain values or texts which DIAdem moves according to the values of the channels to be sorted are in the second channel list.

DIAdem sorts the first channel to be sorted in ascending or descending order. DIAdem accordingly moves the values or text of the following channels and of the included channels to the same positions as their counterparts in the first channel. If two values in the first channel are the same, DIAdem includes the sort criteria of the second channel. If two more values in the second channel are also the same, the third channel is used, and so on. If there are two entries with the same channel in the channel list, DIAdem only includes one.

DIAdem generates the same number of result channels as the number of channels to be sorted and the further channels to be sorted. The shortest channel to be sorted specifies the length of all result channels. However, DIAdem does not use 0 length channels for the determination of the length. After calculating, DIAdem fills the 0 length channels up to the length of the result channels with NoValues.

If you want to use waveform channels in this dialog box, this function converts the channels into numeric channels (Rule 1 for Calculating with Waveform Channels.

The following example creates a text channel and a numeric channel. DIAdem sorts the text channel and sorts the numeric channel at the same time.


VBScriptPython

 

Dim MyChnGroup1, MyChnGroup2, MyTextChn1, MyTextChn2, MyNumericChn1, MyNumericChn2, i
Data.Root.Clear
Set MyChnGroup1 = Data.Root.ChannelGroups.Add ("Sorted")
Set MyChnGroup2 = Data.Root.ChannelGroups.Add ("Moved")
Set MyTextChn1 = MyChnGroup1.Channels.Add("Text", DataTypeString)
Set MyNumericChn1 = MyChnGroup1.Channels.Add("Numbers", DataTypeChnFloat64)
Set MyNumericChn2 = MyChnGroup2.Channels.Add("MovedNumbers", DataTypeChnFloat64)
MyTextChn1.Values(1) = "abc"
MyTextChn1.Values(2) = "aBc"
MyTextChn1.Values(3) = "Abc"
MyTextChn1.Values(4) = "Abc"
For I = 1 To 4
  MyNumericChn1.Values(I) = I
  MyNumericChn2.Values(I) = I
Next

Set ChnResult = ChnMultipleSortExt(MyChnGroup1.Channels ,MyNumericChn2, "Up,Down", "UpperCase,CaseInsensitive", 0)

Dialog Box Call

Call SUDDlgShow("Main", ResourceDrv & "AnaChnMultipleSort")

Sort Channel Values

 

Related Topics

Command: ChnAverage | Command: ChnConvertTextToAssignment | Command: ChnDeriveCalc | Command: ChnDetrendCalc | Command: ChnDifferentiate | Command: ChnEnclosedArea | Command: ChnIntegrate | Command: ChnMirror | Command: ChnMultipleSort | Command: ChnNormalize | Command: ChnNovHandle | Command: ChnOptimizeDataType | Command: ChnPeakFind | Command: ChnPhaseUnwrap | Command: ChnPhaseWrap | Command: ChnRangeLimit | Command: ChnRelativize | Command: ChnRMS | Command: ChnRound | Command: ChnSum

Was this information helpful?