DataRange::Reset

Description

Clear all the subranges.

Syntax

void Reset( )

Parameters

Return

Examples

EX1

//Reset the datarange.
void DataRange_Reset_Ex1()
{
        //Create a worksheet with two columns.
        Worksheet wks;
        wks.Create();
    if( wks )
    {
        while(wks.Columns(0))
            wks.DeleteCol(0);
 
        wks.AddCol("A");
        wks.AddCol("B");
        
        //Create a datarange with X and Y subranges.
        DataRange dr;
        dr.Add(wks, 0, "X");
        dr.Add(wks, 1, "Y");
        
        if( !dr.IsEmpty() )
                out_str("The datarange is not empty");
        
        dr.Reset();//clear all subranges.
        if( dr.IsEmpty() )
                out_str("The datarange is empty");
    }
                
}

Remark

See Also

header to Include

origin.h