curvebase::Sort

Description

Use a Curve object to sort a Y data set according to an X data set.

Syntax

BOOL Sort( DWORD dwFlags = 0 )

Parameters

dwFlags
[input] Sort options. Default 0 sorts in ascending order and places missing values at the end. See the NS_DESCENDING and NS_MISSING_AS_SMALLEST macro definitions in system header file data.h

Return

Returns TRUE on successful exit and FALSE on error.

Examples

EX1

// Assumes Book1_A and Book1_B exist and contain data, better fill columns with random data as to check the result.
int curvebase_Sort_ex1(string dsName1 = "Book1_A", string dsName2 = "Book1_B")
{
    Curve crv("Book1_A","Book1_B");
    crv.Sort(NS_DESCENDING | NS_MISSING_AS_SMALLEST);
    return 0;
}

Remark

Use a Curve object to sort a Y data set according to an X data set. This function does nothing if is there is no X data set associated with the Y data set. Please note that constructor of curve that takes two Dataset is just making a copy of the Datasets, they are not attached to the curve. So even you made some changes to the curve, it will not affect the original Dataset. Due to this reason, the curve sort will ONLY work on the X Dataset, So if one want to make sort on Y Dataset, he may need to construct a curve with X and Y dataset swapped first.

See Also

Data_sort

header to Include

origin.h