| 2.2.3.5.2 curvebase::AttachXAttachX
 DescriptionAttach an Origin C Dataset object to the X data set associated with this Curve object.
 SyntaxBOOL AttachX( Dataset & dsX, BOOL SetXRangeToYRange = TRUE ) Parameters dsX[input] A Dataset object which is attached to the X data set of this Curve object (if any) SetXRangeToYRange[input]TRUE (default) sets the upper and lower bounds of the X data set to the upper and lower bounds of the Curve object's Y data set. This setting is temporary and may be over-ridden when using multiple Curve objects linked to the same X data set.
 ReturnReturns TRUE if the Curve object has an associated X data set and the attachment is successful or returns FALSE if there is no X data set or the attachment fails.
 ExamplesEX1
 void curvebase_AttachX_ex1()
{
    // Assumes Book1_A(X) and Book1_B(Y) exist with the following data:
    // Book1_B={1,2,3,4,5,6,7}
    // Book1_A={1,2,3,4,5,6,7,-10,10};
    string dsName = "Book1_B"; 
    Curve crv(dsName);
    Dataset dsX;
    crv.AttachX(dsX, TRUE); //If FALSE, The Minimum/Maximum X is -10/10
    double xMin = min( dsX );
    double xMax = max( dsX );
    printf( "The Minimum X in dsX is %g \n", xMin );
    printf( "The Maximum X in dsX is %g \n", xMax );
}RemarkAttach an Origin C Dataset object to the X data set associated with this Curve object (if there is one) and optionally set the upper and lower bounds of the X data set to the upper and lower bounds of the Curve object's Y data set.
 See AlsoDataset::Attach, Curve::Attach, Curve::Detach, DataRange::GetData, DataRange::GetNumData, DataRange::GetMaskedData, DataRange::GetMissingData
 Header to Includeorigin.h
 |