2.1.5.6 curve_in_page_get_indices


Description

It looks for the curve in the graph page.

Syntax

BOOL curve_in_page_get_indices( const curvebase & cuv, const GraphPage & gpg, int * pnLayerIndex = NULL, int * pnDataPlotIndex = NULL )

Parameters

cuv
[input] the curve to look for
gpg
[input] the graph page to look in.
pnLayerIndex
[input] optional pointer to an integer to receive the index of the layer in which the curve was found
pnDataPlotIndex
[input] optional pointer to an integer to receive the index of the dataplot in the layer if found.

Return

TRUE if found, otherwise FALSE.

Examples

EX1

//This example use function curve_in_page_get_indices() to check whether the data 
//of the specified column exists in each Graph in current folder.
void curve_in_page_get_indices_ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(!wks)
        return;
    Curve crv(wks, 1);
    Folder fld = wks.GetPage().GetFolder();
    //go through all pages in folder to check GraphPage
	foreach(PageBase page in fld.Pages) 
	{
		if(EXIST_PLOT == page.GetType())
		{
			GraphPage gp = page;
			if(crv && gp)
			{
				bool bOK = curve_in_page_get_indices(crv, gp);
				string strCrv = crv.GetName();
				string strGrp = gp.GetName();
				if(bOK)
				{
					out_str(strCrv+" exists in "+strGrp);
				}
				else
				{
					out_str(strCrv+" does not exist in "+strGrp);
				}
			}
		}
	}
}

Remark

curve_in_layer_get_index

See Also

Header to Include

origin.h

Reference