2.2.4.32.46 OriginObject::GetProp


Description

Get object property via LabTalk property name

Syntax

int GetProp(LPCSTR lpcszVarName, double * pdVal = NULL)

Parameters

lpcszVarName
[input] Object property name, case insensitive
pdVal
[input] resulting value, if index variable type, 1 offset, like Labtalk. NULL will return as integer directly

Return

Returns 1 if lpcszVarName is a valid name and 0 if it is not. -1 if error occurs
If pdVal is NULL will return the object property integer value directly

Examples

EX1

//This example assumes the active graph has a line object
void GetProp_Ex()
{
	GraphLayer gl = Project.ActiveLayer();
	if( gl.IsValid() )
	{
		GraphObject	go;
		go = gl.GraphObjects("Line");
		if( go.IsValid() )
		{
			double vv;
			int nn = go.GetProp("color", &vv);
			printf("ret = %d, color = %g\n", nn, vv);
			out_int("can also directly get integer return value: ", go.GetProp("color"));
			
			Tree trColor;
			trColor=go.GetFormat(FPB_STYLE_COLOR, FOB_OBJECT, TRUE, TRUE);
			out_int("trColor.Root.Color.nVal=", trColor.Root.Color.nVal);
		}
	}
}

Remark

See Also

OriginObject::SetProp
LT_evaluate
Layer::LT_execute

Header to Included

origin.h