SetLabel
Set the label (RCLT_LONG_NAME, RCLT_UNIT, RCLT_COMMENT, .. ) from the DatasetObject.
BOOL SetLabel(LPCSTR lpcszLabel, int nType, BOOL bX)
TRUE on success and FALSE on failure.
EX1
void DatasetObject_SetLabel_Ex1() { Worksheet wks = Project.ActiveLayer(); if( !wks ) return; Column col = wks.Columns(0); DatasetObject obj(col); if( obj && obj.SetLabel("test ok", RCLT_LONG_NAME, false) ) out_str("set long name done."); else out_str("fail to set long name."); }
EX2
//assume there is a function plot void DatasetObject_SetLabel_Ex2() { GraphLayer gl = Project.ActiveLayer(); if( gl ) { DataPlot dp = gl.DataPlots(); DatasetObject dsObj(dp.GetDatasetName()); BOOL bSuccess = dsObj.SetLabel("My Function", RCLT_LONG_NAME, FALSE); if(bSuccess) { gl.Invalidate(); out_str("Set Long Name done."); } } }
DatasetObject::GetLabel
origin.h