2.2.4.38.22 Project::GetDatasetInfo

Description

Get Dataset information

Syntax

DWORD GetDatasetInfo( LPCTSTR lpcszDatasetName, BOOL bNeedFolderInfo = FALSE, LPDatasetInfoMore pstMore = NULL )

Parameters

lpcszDatasetName
[input]name of the Dataset object
bNeedFolderInfo
[input]get folder info if the Dataset is one of the columns in a worksheet which could be inside a sub folder.
To get subfolder info, it needs to do some searching so will take more time.
pstMore
More dataset info :
typedef struct tagDatasetInfoMore
{
	char		szDependent[MAXLINE];		/// corresponding 'X' dataset when plotting
}DatasetInfoMore, *LPDatasetInfoMore;

Return

return value is a DWORD with LOWORD defined in oc_const.h, can be one of the followings

PGDN_PLOTTABLE = 0x0001,

PGDN_IN_WKS = 0x0002,

PGDN_IN_MATRIX = 0x0004,

PGDN_IS_DATASET = 0x0008,

PGDN_LOOSE = 0x0010,

PGDN_FOLDER = 0x0020,

PGDN_FOLDER_SUB = 0x0040

PGDN_FUNCTION = 0x1000

PGDN_TEMP_DATASET = 0x2000


return HIWORD contains internal data type, FSI_DOUBLE, FSI_SHORT, FSI_MIXED etc.

Examples

EX1

void Project_GetDatasetInfo_ex1()
{
    DWORD dwInfo;
    foreach (string strDatasetName in Project.DatasetNames)
    {
        dwInfo = Project.GetDatasetInfo(strDatasetName);
        printf("Info(Dataset %s) = 0x%X, data type = %d\n", strDatasetName, LOWORD(dwInfo), HIWORD(dwInfo));  
    }
}

EX2

void Project_GetDatasetInfo_ex2(string strDatasetName)
{
    DWORD dwInfo = Project.GetDatasetInfo(strDatasetName, true);
    if(dwInfo == 0)
    {
        printf("%s is not a dataset\n", strDatasetName);
        return;
    }
    if(dwInfo & PGDN_FOLDER)
        printf("dataset %s is in one of the worksheets in current folder\n", strDatasetName);
    else if(dwInfo & PGDN_FOLDER_SUB)
        printf("dataset %s is not in one of the worksheets in current folder, but it is inside one of the subfolders\n", strDatasetName);
    else
        printf("dataset %s is not in current folder, nor in any of its subfolders\n", strDatasetName);
}

Remark

See Also

Project::GetDatasetMasks, Project::GetDatasetPlotList

Header to Include

origin.h