Dataset::IsValid

Description

Checks the validity of an Origin C Dataset object.

Syntax

BOOL IsValid( )

Parameters

Return

Returns TRUE if Dataset object is valid and FALSE if not.

Examples

EX1

void Dataset_IsValid_ex1()
{
    // a Worksheet with at least 1 column must exist prior to execution
    Worksheet wks=Project.ActiveLayer();
    if (wks)
    {
        string strWksColname = wks.Columns(0).GetName();
        strWksColname = wks.GetPage().GetName() + "_" + strWksColname;
        
        Dataset dsA;                              // Dataset is not yet attached and is not valid
        if(dsA.IsValid())
            out_str("Dataset is valid!");
        else
            out_str("Dataset is not valid!");
        dsA.Attach(strWksColname);                // Dataset is now attached and is valid
        if(dsA.IsValid())
            out_str("Dataset is valid!");
        else
            out_str("Dataset is not valid!");
    }
}

Remark

Checks the validity of an Origin C Dataset object. Dataset objects are valid when they are successfully attached to an internal Origin data set.

See Also

Dataset::Attach, Dataset::Detach

header to Include

origin.h