Dataset::Destroy

Description

Detach the Origin C Dataset object and destroy (delete) the internal Origin data set.

Syntax

void Destroy( )

Parameters

Return

Examples

EX1

void Dataset_Destroy_ex1()
{
    // Worksheet's first column must exist prior to execution
    int ii;
    Dataset    ds1;
    ds1.Create(3,1);           // Create data set with Size=3 & Option=1 (not a temporary data set)
    for(ii = 0; ii < 3; ii++)
        ds1[ii] = ii;
    LT_execute("list s;");     // Note new ds1 TEMP_ data set
    ds1.Destroy();             // Destroy ds1 TEMP_ data set
    LT_execute("list s;");     // Note new ds1 TEMP_ data set is destroyed
    
    Worksheet wks=Project.ActiveLayer();
    if (wks)
    {
        Dataset    ds2(wks, 0);    // Construct and attach to pre-existing Origin data set
        ds2.Destroy();             // Detaches ds2 from wks(0) but does not delete pre-existing data set from Origin
        LT_execute("list s;");     // Note ds2 is an Invalid Object but wks(0) still exists 
        
    }

}

Remark

Delete (destroy) an Origin data set created using the Dataset::Create method. For data sets not created by the Dataset::Create method the Destroy method functions identically to the Dataset::Detach method.

See Also

Dataset::Detach, Dataset::Attach, Dataset::Create

header to Include

origin.h