DataRange::Clone

Description

Get a copy of the datarange.

Syntax

BOOL Clone( DataRange & drDest, BOOL bPreserveSecurityDescriptor = FALSE )

Parameters

drDest
[output] the object to save the cloned datarange
bPreserveSecurityDescriptor
[input] whether keep drDest's security descriptor

Return

Examples

//Create a copy of XY DataRange.
void DataRange_Clone_Ex1()
{
        //assume there exists an active worksheet with three colulmns
        Worksheet wks = Project.ActiveLayer();
        if ( !wks )
        {
                printf("Can not find any active worksheet!");
                return;
        }
        DataRange dr;
        dr.Create();//init the object
        dr.Add("X", wks, 0, 0, -1, 0);//add the first column as x range
        dr.Add("Y", wks, 0, 1, -1, 1);
        
        DataRange drCloned;
        dr.Clone(drCloned);
        drCloned.Add("Z", wks, 0, 2, -1, 2);//add one more range to the copy, this operation has no effect on dr
        return;
}

Remark

See Also

header to Include

origin.h