2.2.4.32.10 OriginObject::DoMethod


Description

Execute object LabTalk methods

Syntax

int DoMethod( LPCSTR lpcszCmd, DWORD dwCntrl = 0, double * pdVal = NULL )
int DoMethod( LPCSTR lpcszCmd, LPCSTR lpcszArg, double * pdVal = NULL);

Parameters

lpcszCmd
[input] Object method name, case insensitive
dwCntrl
[input] method's input if require
pdVal
[output] return value, if index variable type, 1 offset, like Labtalk
lpcszCmd
[input] Object method name, case insensitive
lpcszArg
[input] method's input if require
pdVal
[output] return value, if index variable type, 1 offset, like Labtalk

Return

Returns 1 if lpcszCmd is a valid method and 0 if it is not. -1 if error occurs If pdVal is NULL will return the method return integer value directly

Examples

EX1

void DoMethod_ex1(string strSheetName)
{
	Page pg = Project.Pages();
	double dRet;
	int nRet = pg.DoMethod("layerNumber", strSheetName, &dRet);
	int nRet2 = pg.DoMethod("layerNumber", strSheetName);
}

EX2

void DoMethod_ex2()
{
	Worksheet wks = Project.ActiveLayer();
	int nn = wks.DoMethod("dc.Allow", 1);
	out_int("wks.dc.Allow(1) = ", nn);
}

Remark

See Also

OriginObject::SetProp
LT_evaluate
Layer::LT_execute

Header to Included

origin.h