Get Dataset information
DWORD GetDatasetInfo( LPCTSTR lpcszDatasetName, BOOL bNeedFolderInfo = FALSE, LPDatasetInfoMore pstMore = NULL )
typedef struct tagDatasetInfoMore { char szDependent[MAXLINE]; /// corresponding 'X' dataset when plotting }DatasetInfoMore, *LPDatasetInfoMore;
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.
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); }
Project::GetDatasetMasks, Project::GetDatasetPlotList
origin.h